-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Description
Summary
Building library/std for hexagon-unknown-qurt from the current rust-lang/rust master (using a custom bootstrap.toml for Hexagon/QURT toolchain) fails. I hit a sequence of failures (libunwind headers, then libc target support), and even after switching to a local libc fork + allowing warnings, std still fails with many missing libc symbols/types and missing platform modules.
Steps to reproduce (Command used)
-
Clone Rust:
git clone https://github.com/rust-lang/rust.git cd rust- rust
git rev-parse HEAD:7704328ba5ae8d6ce0ac303c9d5a1a1605906766
- rust
-
Create
bootstrap.toml(example below) and point it at the Hexagon toolchain. -
Clean and build std for Hexagon/QURT:
./x.py clean ./x.py build --stage 1 library/std --target hexagon-unknown-qurt
Expected behaviour
./x.py build --stage 1 library/std --target hexagon-unknown-qurt succeeds (or fails with a clear “target unsupported” message if this target is not expected to build std).
Actual behaviour
-
Baseline: build from current Rust git + recommended-ish bootstrap.toml
Command:./x.py build --stage 1 library/std --target hexagon-unknown-qurt
Failure (libunwind build step) (terminal_output_ver1.txt):
- While building
libunwind.aforhexagon-unknown-qurt, compilation fails becauselink.his missing:
.../libunwind/src/AddressSpace.hpp: fatal error: 'link.h' file not found - While building
-
Tried disabling libunwind
Change:- Set
llvm-libunwind = "no"andbacktrace = false.
Result terminal_output_ver2.txt:
- This allowed progress past the libunwind failure, but the build later failed in
libc/stdcompilation:error[E0432]: unresolved import 'unistd'(coming fromlibcinternals for the target).
- Set
-
Switched to local libc (fork/path override)
Attempted:cargo update -p libc(updatedlibcversion in the lockfile, but did not resolve the target issue).- Switched to a local libc checkout/fork (path override) based on
rust-lang/libcwith QURT/hexagon adjustments. - clib
git rev-parse HEAD:4b38c69e31afadbead63af49794850b5a41f7dc4
Result terminal_output_ver3.txt:
- Build aborted due to “warnings are denied …” (warnings treated as errors).
-
Tried allowing warnings
Attempt:- Added
deny-warnings = falseinbootstrap.toml.
Result terminal_output_ver4.txt:
-
The build moved forward using the local libc, but then generated many libc-related issues:
- lots of missing libc functions/constants/types (
open,pread,pwrite,fcntl,O_*, socket constants, signals, etc.). - and additional errors where libc items are present but not publicly exported as expected (private type aliases/modules).
- lots of missing libc functions/constants/types (
-
In addition,
stdfails with missingplatformmodules forunixpaths (e.g. cannot findplatform::fs/platform::raw).
- Added
Bootstrap configuration (bootstrap.toml)
[build]
build-stage = 1
host = ["x86_64-unknown-linux-gnu"]
target = ["x86_64-unknown-linux-gnu", "hexagon-unknown-qurt"]
[target.hexagon-unknown-qurt]
cc = "/home/user/Projects/qualcomm/5.5.2.0/tools/HEXAGON_Tools/8.7.06/Tools/bin/hexagon-clang"
cxx = "/home/user/Projects/qualcomm/5.5.2.0/tools/HEXAGON_Tools/8.7.06/Tools/bin/hexagon-clang++"
ar = "llvm-ar"
ranlib = "llvm-ranlib"
llvm-libunwind = 'in-tree'Also tried:
[rust]
backtrace = false
[target.hexagon-unknown-qurt]
llvm-libunwind = "no"And:
[rust]
deny-warnings = falseOperating system
- Host:
x86_64-unknown-linux-gnu(Linux VM) - Target:
hexagon-unknown-qurt - Hexagon toolchain:
hexagon-clang/clang++from Qualcomm HEXAGON Tools (8.7.06) (paths inbootstrap.toml) - Build command:
./x.py build --stage 1 library/std --target hexagon-unknown-qurt
HEAD
rust git rev-parse HEAD: 7704328ba5ae8d6ce0ac303c9d5a1a1605906766
clib git rev-parse HEAD: 4b38c69e31afadbead63af49794850b5a41f7dc4
Additional context
- Is
hexagon-unknown-qurtexpected to support buildingstdin-tree?- It seems like it suggests/targets std support based on:
rust-lang/rusttarget support PR: Add support for hexagon-unknown-qurt target #147173.rust-lang/libcQuRT support commit: rust-lang/libc@8ecae6c.- target documentation (mentions
std): https://doc.rust-lang.org/nightly/rustc/platform-support/hexagon-unknown-qurt.html.
- It seems like it suggests/targets std support based on:
- If yes: what is the intended libc + unwind setup for this target (in-tree libunwind vs SDK/unwindless, libc source/version/branch)?
- If no: is there an official stance / tracking issue for
core/alloc-only vsstdsupport for this target?