rust-lang / rust-lang/rust

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

Open
#151,212 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug O-hexagon-unknown-qurt
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

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)
  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the hexagon-unknown-qurt platform-support documentation and reproduce ./x.py build --stage 1 library/std --target hexagon-unknown-qurt using the reported bootstrap.toml. Trace the libunwind and libc failures, including missing platform modules in std, and compare them with the referenced Rust target-support and libc changes. Done means documenting the supported std setup or producing a clear unsupported-target result.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, embedded-iot, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.