Skip to content

Commit 80e43c1

Browse files
committed
patch an ELF file using --add-rpath
1 parent 4281c2c commit 80e43c1

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/bootstrap/src/core/download.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,10 @@ impl Config {
173173
}
174174

175175
let mut patchelf = Command::new(nix_deps_dir.join("bin/patchelf"));
176-
let rpath_entries = {
177-
// ORIGIN is a relative default, all binary and dynamic libraries we ship
178-
// appear to have this (even when `../lib` is redundant).
179-
// NOTE: there are only two paths here, delimited by a `:`
180-
let mut entries = OsString::from("$ORIGIN/../lib:");
181-
entries.push(t!(fs::canonicalize(nix_deps_dir)).join("lib"));
182-
entries
183-
};
184-
patchelf.args(&[OsString::from("--set-rpath"), rpath_entries]);
176+
patchelf.args(&[
177+
OsString::from("--add-rpath"),
178+
OsString::from(t!(fs::canonicalize(nix_deps_dir)).join("lib")),
179+
]);
185180
if !path_is_dylib(fname) {
186181
// Finally, set the correct .interp for binaries
187182
let dynamic_linker_path = nix_deps_dir.join("nix-support/dynamic-linker");

0 commit comments

Comments
 (0)