Skip to content

Commit 7b151cf

Browse files
committed
fix(bootstrap/darwin): fix rpath for distributed LLD
1 parent 8d1a764 commit 7b151cf

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Change this file to make users of the `download-ci-llvm` configuration download
22
a new version of LLVM from CI, even if the LLVM submodule hasn’t changed.
33

4-
Last change is for: https://github.com/rust-lang/rust/pull/161049
4+
Last change is for: https://github.com/rust-lang/rust/pull/163954

‎src/bootstrap/src/core/build_steps/llvm.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,15 +1724,19 @@ impl CommandLineStep for Lld {
17241724
if builder.config.rpath_enabled(target)
17251725
&& helpers::use_host_linker(target)
17261726
&& llvm_output.link_shared()
1727-
&& target.contains("linux")
17281727
{
17291728
// So we inform LLD where it can find LLVM's libraries by adding an rpath entry to the
17301729
// expected parent `lib` directory.
17311730
//
17321731
// Be careful when changing this path, we need to ensure it's quoted or escaped:
17331732
// `$ORIGIN` would otherwise be expanded when the `LdFlags` are passed verbatim to
17341733
// cmake.
1735-
ldflags.push_all("-Wl,-rpath,'$ORIGIN/../../../'");
1734+
if target.contains("linux") {
1735+
ldflags.push_all("-Wl,-rpath,'$ORIGIN/../../../'");
1736+
}
1737+
if target.contains("apple-darwin") {
1738+
ldflags.push_all("-Wl,-rpath,'@loader_path/../../../'");
1739+
}
17361740
}
17371741

17381742
configure_cmake(builder, target, &mut cfg, true, ldflags, CcFlags::default(), &[]);

0 commit comments

Comments
 (0)