Repository navigation
rust-objcopy on aarch64-apple-darwin cannot load libLLVM.dylib (rpath @loader_path/../lib); not covered by #163954 #164063
Copy link
Copy link
Open
Labels
A-llvm-bintoolsArea: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.Area: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.C-bugCategory: This is a bug.Category: This is a bug.O-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeO-macosOperating system: macOSOperating system: macOSP-highHigh priorityHigh priorityT-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)regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Activity
- addedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Oct 10, 2026 Update: Linux is affected as well, not just darwin. On x86_64-unknown-linux-gnu,
rust-objcopyonly carriesRUNPATH [$ORIGIN/../lib](checked 1.89.0, 1.96.0, 1.98.1), so outside rustup'sLD_LIBRARY_PATHit fails withlibLLVM.so.22.1-rust-1.98.1-stable: cannot open shared object file. Unlike darwin this isn't a recent regression. Proposed fix for both platforms: #164064.- addedO-macosOperating system: macOSOperating system: macOSregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.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)O-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeA-llvm-bintoolsArea: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.Area: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.
on Oct 10, 2026 - addedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Oct 10, 2026 - addedC-bugCategory: This is a bug.Category: This is a bug.O-macosOperating system: macOSOperating system: macOSregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.O-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeA-llvm-bintoolsArea: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.Area: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingand removedO-macosOperating system: macOSOperating system: macOSregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.O-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingA-llvm-bintoolsArea: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.Area: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.
on Oct 10, 2026 - removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Oct 10, 2026 Assigning P-high (discussion on Zulip).
Metadata
Metadata
Assignees
Labels
A-llvm-bintoolsArea: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.Area: LLVM bintools (`llvm-nm` et.). Note that `llvm-tools{,-preview` has no stability guarantees.C-bugCategory: This is a bug.Category: This is a bug.O-AArch64Armv8-A or later processors in AArch64 modeArmv8-A or later processors in AArch64 modeO-macosOperating system: macOSOperating system: macOSP-highHigh priorityHigh priorityT-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)regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Projects
- StatusShow more project fieldsIn progress
On
aarch64-apple-darwin,rust-objcopy(shipped in therustccomponent) has the same broken rpath asrust-lldin #163947, but #163954 doesn't fix it. That PR only changes the rpath flags in theLldbootstrap step.rust-objcopyis a renamed copy ofllvm-objcopyfrom the main LLVM build (compile.rs, "copyingllvm-objcopyasrust-objcopy"), so it keeps LLVM's default@loader_path/../lib.Since #157205 (first stable: 1.98.0),
rust-objcopylinkslibLLVM.dylibdynamically:@loader_path/../libresolves tolib/rustlib/aarch64-apple-darwin/lib/. Therustccomponent ships the dylib only atlib/libLLVM.dylib, permanifest-rustc-aarch64-apple-darwin. On 1.97.0,rust-objcopydoesn't linklibLLVMat all.Impact
rustc runs
rust-objcopyto strip debuginfo (the default for release profiles on macOS). When it runs without rustup'sDYLD_FALLBACK_LIBRARY_PATHshim, dyld aborts it withLibrary not loaded: @rpath/libLLVM.dylib(SIGABRT). rustc reports that as a warning only, so the build succeeds but the binary keeps its debuginfo. For example, one of our release binaries came out at 57 MB instead of being stripped. This is easy to miss in CI and packaging.Workaround
Same as #163947:
ln -s ../../../libLLVM.dylib "$(rustc +1.98.1 --print sysroot)/lib/rustlib/aarch64-apple-darwin/lib/libLLVM.dylib"Suggested fix
Add
@loader_path/../../../to the rpath of the LLVM tools copied intolib/rustlib/<host>/bin, the same way #163954 does for LLD. That could go in the LLVM cmake step's ldflags, or come from aninstall_name_tool -add_rpathwhenrust-objcopyis copied. I haven't checked whether Linuxrust-objcopyhas a matching$ORIGIN/../../../entry.Meta
I've only tested 1.98.1. I expect 1.99.0 to behave the same, because #163954 doesn't touch this path.
Disclosure: diagnosis and draft were produced with an LLM (Claude) and checked by me against the toolchain on my machine.