Skip to content

x.py build --stage 1 library/std --target hexagon-unknown-qurt fails: libunwind requires link.h; std then fails due to missing libc/platform items #151212

Description

@aviad-kardome

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)

  1. Clone Rust:

    git clone https://github.com/rust-lang/rust.git
    cd rust
    • rust git rev-parse HEAD: 7704328ba5ae8d6ce0ac303c9d5a1a1605906766
  2. Create bootstrap.toml (example below) and point it at the Hexagon toolchain.

  3. 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

  1. 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.a for hexagon-unknown-qurt, compilation fails because link.h is missing:
    .../libunwind/src/AddressSpace.hpp: fatal error: 'link.h' file not found
    
  2. Tried disabling libunwind
    Change:

    • Set llvm-libunwind = "no" and backtrace = false.

    Result terminal_output_ver2.txt:

    • This allowed progress past the libunwind failure, but the build later failed in libc/std compilation:
      • error[E0432]: unresolved import 'unistd' (coming from libc internals for the target).
  3. Switched to local libc (fork/path override)
    Attempted:

    • cargo update -p libc (updated libc version in the lockfile, but did not resolve the target issue).
    • Switched to a local libc checkout/fork (path override) based on rust-lang/libc with 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).
  4. Tried allowing warnings
    Attempt:

    • Added deny-warnings = false in bootstrap.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).
    • In addition, std fails with missing platform modules for unix paths (e.g. cannot find platform::fs / platform::raw).

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 = false

Operating 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 in bootstrap.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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions