Skip to content

bootstrap: add an rpath to LLVM library for LLVM tools - #164134

Open
danieljhkim wants to merge 1 commit into
rust-lang:mainfrom
danieljhkim:fix-rust-objcopy-rpath
Open

danieljhkim wants to merge 1 commit into
rust-lang:mainfrom
danieljhkim:fix-rust-objcopy-rpath

Conversation

@danieljhkim

@danieljhkim danieljhkim commented Oct 11, 2026 •

Copy link
Copy Markdown

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

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

linux

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]

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 11, 2026
@danieljhkim
danieljhkim marked this pull request as ready for review October 11, 2026 03:38
@rustbot

rustbot commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 11, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 11, 2026
@rustbot

rustbot commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@danieljhkim
danieljhkim force-pushed the fix-rust-objcopy-rpath branch from cc8d7a0 to ec60f65 Compare October 11, 2026 03:40
@Kobzol

Kobzol commented Oct 11, 2026

Copy link
Copy Markdown
Member

r? kobzol

Thanks for the PR. Two remarks:

  • We now have the same logic duplicated on three places (OmpOffload, Lld and Llvm). Could you please extract it to a shared function that takes a builderand atarget`? The function should only be called if we link LLVM dynamically.
  • Won't the linker flags be also applied to libLLVM.so itself? Have you tried building it on Linux and running lld on it - if yes, what does it print?

@rustbot rustbot assigned Kobzol and unassigned Mark-Simulacrum Oct 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust-objcopy on aarch64-apple-darwin cannot load libLLVM.dylib (rpath @loader_path/../lib); not covered by #163954

4 participants