Repository navigation
bootstrap: add an rpath to LLVM library for LLVM tools - #164134
Conversation
|
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. |
|
Thanks for the pull request, and welcome! The Rust Project has assigned @Mark-Simulacrum (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
cc8d7a0 to
ec60f65
Compare
|
r? kobzol Thanks for the PR. Two remarks:
|
d548031 to
b2d5f18
Compare
@Kobzol thanks for the review. I have updated the PR to use a common helper (llvm_lib_rpath) as requested. The fix pushes rpath into ldflags.exe, which only applies when linking executables, and libLLVM.so is linked with the shared-library flags. Below are verifications I ran on linux. |
b2d5f18 to
8a83fe8
Compare
This comment has been minimized.
This comment has been minimized.
8a83fe8 to
badf2aa
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Extract the rpath logic shared by `Llvm`, `Lld` and `OmpOffload` into `llvm_lib_rpath`.
dffd58f to
46395c5
Compare
|
Thanks! @bors r+ |
Rollup of 7 pull requests Successful merges: - #163798 (validate generic parameter remapping in delegation) - #164134 (bootstrap: add an rpath to LLVM library for LLVM tools) - #164190 (Tweak wording of "expected/found signature" errors) - #163578 (Add internal #[rustc_assert_variance] attribute for use in std) - #164126 (tests: Ignore dynamic-loading-cdylib on musl hosts) - #164171 (More `tests/rustdoc-html` cleanups) - #164221 (tests: cover `dead_code_pub_in_binary` expectations with `--test`)
Rollup merge of #164134 - danieljhkim:fix-rust-objcopy-rpath, r=Kobzol bootstrap: add an rpath to LLVM library for LLVM tools Closes [#164063](#164063) by adding rpath to the LLVM tool executables on both Linux and macOS, using the same approach as Lld::run. This PR is now written by a human, resubmitting [#164064](#164064) which was diagnosed and written by Claude. **Validation:** macOS ```bash ❯ otool -l ~/workspace/repos/rust/build/aarch64-apple-darwin/llvm/bin/llvm-objcopy | grep -A2 LC_RPATH cmd LC_RPATH cmdsize 40 path @loader_path/../../../ (offset 12) -- cmd LC_RPATH cmdsize 32 path @loader_path/../lib (offset 12) ❯ otool -L build/aarch64-apple-darwin/llvm/lib/libLLVM.dylib build/aarch64-apple-darwin/llvm/lib/libLLVM.dylib: @rpath/libLLVM.dylib (compatibility version 1.0.0, current version 23.1.3) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1359.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 2200.27.0) ``` linux ```bash readelf -d build/x86_64-unknown-linux-gnu/llvm/bin/llvm-objcopy | grep RUNPATH 0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../../../:$ORIGIN/../lib:$ORIGIN/../lib/x86_64-unknown-linux-gnu] ```
Closes #164063 by adding rpath to the LLVM tool executables on both Linux and macOS, using the same approach as Lld::run.
This PR is now written by a human, resubmitting #164064 which was diagnosed and written by Claude.
Validation:
macOS
linux