Skip to content

Conversation

@heiher
Copy link
Contributor

@heiher heiher commented Jul 15, 2023

What does this PR try to resolve?

When building the Rust toolchain with --libdir=lib64, the executable tools such as rustc cannot find shared libraries.

./configure --prefix=/ --libdir=lib64
DESTDIR=/tmp/rust ./x.py install
$ /tmp/rust/bin/rustc
rustc: error while loading shared libraries: librustc_driver-13f1fd1bc7f7000d.so: cannot open shared object file: No such file or directory

This issue is caused by the link args -Wl,rpath being different from --libdir.

$ readelf -d /tmp/rust/bin/rustc | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib]

How to resolve?

When setting the rpath, get it from sysroot libdir relative path.

After this patch:

$ readelf -d /tmp/rust/bin/rustc | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib64]

@rustbot
Copy link
Collaborator

rustbot commented Jul 15, 2023

r? @clubby789

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 15, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@heiher
Copy link
Contributor Author

heiher commented Jul 15, 2023

The job mingw-check-tidy failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)

Why cannot get cache from a merged commit? https://ci-artifacts.rust-lang.org/rustc-builds-alt/bef6ff618f17398775e9d8cd23a6f47d983869dc/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz

@clubby789
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 19, 2023

📌 Commit e326e1a has been approved by clubby789

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 19, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 20, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#113710 (Fix rpath for libdir is specified)
 - rust-lang#113787 (Update documentation for std::process::Command's new method)
 - rust-lang#113795 (Properly document `lifetime_mapping` in `OpaqueTy`)
 - rust-lang#113857 (Add tests for `--document-hidden-items` option)
 - rust-lang#113871 (Use the correct span for displaying the line following a derive sugge…)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8027dd9 into rust-lang:master Jul 20, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 20, 2023
@heiher heiher deleted the fix-rpath branch July 28, 2023 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants