Repository navigation
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
hello everyone,
I'm building rust for a custom musl target and was about to test the 1.91.0_beta, but the build process fails due to seemingly missing libs:
running: RUSTC_BOOTSTRAP="1" "/var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/build/armv7a-unknown-linux-musleabihf/stage1/bin/rustc" "--print=target-spec-json-schema" "-Zunstable-options" (failure_mode=Exit) (created at src/bootstrap/src/core/build_steps/dist.rs:628:21, executed at src/bootstrap/src/core/build_steps/dist.rs:632:24)
Command `RUSTC_BOOTSTRAP="1" "/var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/build/armv7a-unknown-linux-musleabihf/stage1/bin/rustc" "--print=target-spec-json-schema" "-Zunstable-options" (failure_mode=Exit)` failed with exit code 127
Created at: src/bootstrap/src/core/build_steps/dist.rs:628:21
Executed at: src/bootstrap/src/core/build_steps/dist.rs:632:24
--- STDOUT vvv
--- STDERR vvv
Error loading shared library librustc_driver-25f52a4f3a321d15.so: No such file or directory (needed by /var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/build/armv7a-unknown-linux-musleabihf/stage1/bin/rustc)
Error relocating /var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/build/armv7a-unknown-linux-musleabihf/stage1/bin/rustc: _ZN3std2rt19lang_start_internal17hda59b061fa42e575E: symbol not found
Error relocating /var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/build/armv7a-unknown-linux-musleabihf/stage1/bin/rustc: _RNvCs6FONwEGrKIA_17rustc_driver_impl4main: symbol not found
Traceback (most recent call last):
File "/var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/./x.py", line 53, in <module>
bootstrap.main()
~~~~~~~~~~~~~~^^
File "/var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1389, in main
bootstrap(args)
~~~~~~~~~^^^^^^
File "/var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1364, in bootstrap
run(args, env=env, verbose=build.verbose, is_bootstrap=True)
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 237, in run
raise RuntimeError(err)
RuntimeError: failed to run: /var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/build/bootstrap/debug/bootstrap install -v --config=/var/tmp/portage/dev-lang/rust-1.91.0_beta/work/rustc-beta-src/bootstrap.toml -j1
this is my bootstrap.toml config file:
[llvm]
download-ci-llvm = false
optimize = true
release-debuginfo = false
assertions = false
ninja = true
targets = "ARM"
experimental-targets = ""
link-shared = false
[build]
build = "armv7a-unknown-linux-musleabihf"
host = ["armv7a-unknown-linux-musleabihf"]
target = ["armv7a-unknown-linux-musleabihf"]
cargo = "/usr/lib/rust/1.90.0/bin/cargo"
rustc = "/usr/lib/rust/1.90.0/bin/rustc"
docs = false
compiler-docs = false
submodules = false
python = "python3.13"
locked-deps = true
extended = true
tools = ["cargo","rustdoc"]
verbose = 2
sanitizers = false
cargo-native-static = false
[install]
prefix = "/usr/lib/rust/1.91.0_beta"
sysconfdir = "etc"
docdir = "share/doc/rust"
bindir = "bin"
libdir = "lib"
mandir = "share/man"
[rust]
# https://github.com/rust-lang/rust/issues/54872
codegen-units-std = 1
optimize = true
debug = false
debug-assertions = false
debuginfo-level-rustc = 0
backtrace = true
incremental = false
default-linker = "armv7a-unknown-linux-musleabihf-gcc"
channel = "stable"
rpath = false
verbose-tests = true
optimize-tests = true
codegen-tests = true
dist-src = false
# https://github.com/rust-lang/rust/issues/117885
remap-debuginfo = true
lld = false
# try to get rid of llvm-tools-preview
llvm-tools = false
backtrace-on-ice = true
jemalloc = false
# See https://github.com/rust-lang/rust/issues/121124
lto = "off"
[dist]
vendor = false
src-tarball = false
compression-formats = ["xz"]
[target.armv7a-unknown-linux-musleabihf]
cc = "armv7a-unknown-linux-musleabihf-gcc"
cxx = "armv7a-unknown-linux-musleabihf-g++"
linker = "armv7a-unknown-linux-musleabihf-gcc"
ar = "armv7a-unknown-linux-musleabihf-ar"
crt-static = false
the file in question is def. present in the build dir:
./armv7a-unknown-linux-musleabihf/stage1-rustc/armv7a-unknown-linux-musleabihf/release/deps/librustc_driver-25f52a4f3a321d15.so
./armv7a-unknown-linux-musleabihf/stage1/lib/librustc_driver-25f52a4f3a321d15.so
./armv7a-unknown-linux-musleabihf/stage0-sysroot/lib/rustlib/armv7a-unknown-linux-musleabihf/lib/librustc_driver-25f52a4f3a321d15.so
from folder ../rustc-beta-src/build/armv7a-unknown-linux-musleabihf/stage1/bin
I execute ./rustc gives me:
/lib/ld-musl-armhf.so.1 (0xf791e000)
Error loading shared library librustc_driver-25f52a4f3a321d15.so: No such file or directory (needed by rustc)
libgcc_s.so.1 => /usr/lib/gcc/armv7a-unknown-linux-musleabihf/14/libgcc_s.so.1 (0xf790f000)
libc.so => /lib/ld-musl-armhf.so.1 (0xf791e000)
Error relocating rustc: _ZN3std2rt19lang_start_internal17hda59b061fa42e575E: symbol not found
Error relocating rustc: _RNvCs6FONwEGrKIA_17rustc_driver_impl4main: symbol not found
my git-commit-hash is b34cfaf51ab461e8aeb742c40ca790a4e5feefe1 ; 1.91.0_beta bootstrapped via 1.90.0
Additional context
the full build log can be found here: build.log.gz
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Activity
Kobzol commentedon Sep 23, 2025
The problem is not missing libs, but the fact that the library cannot be loaded due to some missing symbols. No idea what could be causing that though, probably something in the custom target spec doesn't work.
stefson commentedon Sep 23, 2025
I believe the symbols are there, the rustc binary just doesn't look at the correct spot:
executed from ../build/armv7a-unknown-linux-musleabihf/stage1/bin:
LD_LIBRARY_PATH=../lib/ ./rustc -vVKobzol commentedon Sep 23, 2025
I see. Could you please run
lddon therustcbinary?stefson commentedon Sep 23, 2025
sure, here is ldd of stage1-rustc:
I played around a bit, don't know if its legal to add LD_PRELOAD before pointing with ldd on a binary, but I did it anyway:
LD_LIBRARY_PATH=../lib/ ldd rustc
and I see a potential illegal double
//in the lib path 🧐Kobzol commentedon Sep 23, 2025
Umm, that's a bit weird output, normally when I run
lddand the library is not found, it either prints the path under which it wants to find it, or it just output something like "not found". Due to how the path looks when you specify theLD_LIBRARY_PATH, I wonder if the "real" path is something like/librustc_driver-..., which is clearly not correct. What doesLD_LIBRARY_PATH=../lib ldd rustcoutput?stefson commentedon Sep 23, 2025
ah I'm sorry, with
../libits now the correct output:mati865 commentedon Sep 24, 2025
Just confirming, double
//in the path is fine, it's just cosmetic.Given this is a build with
rpath = false, perhaps bootstrap should set the library path?Kobzol commentedon Sep 25, 2025
Hmm, right,
rpathshould really be enabled.stefson commentedon Oct 3, 2025
if I enable
rpath = truefor rust-1.90.0, it won't compileif I enable
rpath = truefor rust-1.91.0, it will compile and install, but it won't be able to locatelibrustc_driver-c1aa1ccb99129417.soat runtime, leading to a broken rust binary.maybe it's a confusion about stage1 and stage2 rustc during install?
stefson commentedon Oct 18, 2025
fixed via #147571