Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap failed when multilibs are enabled in yocto environment from 1.83 #138983

Closed
DeepeshvRajan opened this issue Mar 26, 2025 · 2 comments
Closed
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@DeepeshvRajan
Copy link

In Yocto, we are attempting to build Rust with multilibs enabled. During the process, due to an additional check introduced in Rust 1.83 (68034f8), the bootstrap process attempts to execute the following command:

rust/build/tmp/work/core2-64-poky-linux/rust/1.83.0/rustc-1.83.0-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --target=x86_64-poky-linux-gnu --print=file-names --crate-type=proc-macro

However, it fails with the following error:

rust/build/tmp/work/core2-64-poky-linux/rust/1.83.0/rustc-1.83.0-src/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-8f30db6f3d93a748.so: cannot open shared object file: No such file or directory

The failure occurs because the dependent .so files for rustc are placed inside the lib64 directory, but rustc is trying to find them in the lib directory. This issue only happens in Stage 1 of the build process. In Stage 2, the behavior works as expected, with rustc correctly searching in the lib64 directory.

For stage1 :

rust/build/tmp/work/core2-64-poky-linux/rust/1.83/rustc-1.83.0-src/build/x86_64-unknown-linux-gnu/stage1/bin > readelf -d rustc

Dynamic section at offset 0x2dc0 contains 27 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [librustc_driver-109effcb13e61f4a.so]
 0x0000000000000001 (NEEDED)             Shared library: [libstd-48bf5a1412e91aba.so]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001d (RUNPATH)            Library runpath: [rust/build/tmp/work/core2-64-poky-linux/rust/1.83.0/recipe-sysroot-native/usr/lib:rust/build/tmp/work/core2-64-poky-linux/rust/1.83.0/recipe-sysroot-native/lib:$ORIGIN/../lib]

For stage2 :

rust/build/tmp/work/core2-64-poky-linux/rust/1.83.0/rustc-1.83.0-src/build/x86_64-unknown-linux-gnu/stage2/bin > readelf -d rustc

Dynamic section at offset 0x2dc0 contains 27 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [librustc_driver-ca461ae9df3c32c3.so]
 0x0000000000000001 (NEEDED)             Shared library: [libstd-e58ab20a7b688164.so]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001d (RUNPATH)            Library runpath: [rust/build/tmp/work/core2-64-poky-linux/rust/1.83.0/recipe-sysroot-native/usr/lib:rust/build/tmp/work/core2-64-poky-linux/rust/1.83.0/recipe-sysroot-native/lib:$ORIGIN/../lib64]

During the bootstrapping process, we've noticed that when RPATH is set to true for Rust, it points to $ORIGIN/../lib on Linux systems. However, in stage2, it is pointing to $ORIGIN/../lib64, which seems correct. Is this the expected behavior, or are we missing something?

@DeepeshvRajan DeepeshvRajan added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 26, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 26, 2025
@onur-ozkan
Copy link
Member

#136309 fixed this already.

@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 26, 2025
@DeepeshvRajan
Copy link
Author

I confirm that backporting (#136309) fixes the issue. Thanks for sharing the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants