mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
patch an ELF file using --add-rpath
This commit is contained in:
parent
4281c2c3d5
commit
80e43c128c
@ -173,15 +173,10 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut patchelf = Command::new(nix_deps_dir.join("bin/patchelf"));
|
let mut patchelf = Command::new(nix_deps_dir.join("bin/patchelf"));
|
||||||
let rpath_entries = {
|
patchelf.args(&[
|
||||||
// ORIGIN is a relative default, all binary and dynamic libraries we ship
|
OsString::from("--add-rpath"),
|
||||||
// appear to have this (even when `../lib` is redundant).
|
OsString::from(t!(fs::canonicalize(nix_deps_dir)).join("lib")),
|
||||||
// NOTE: there are only two paths here, delimited by a `:`
|
]);
|
||||||
let mut entries = OsString::from("$ORIGIN/../lib:");
|
|
||||||
entries.push(t!(fs::canonicalize(nix_deps_dir)).join("lib"));
|
|
||||||
entries
|
|
||||||
};
|
|
||||||
patchelf.args(&[OsString::from("--set-rpath"), rpath_entries]);
|
|
||||||
if !path_is_dylib(fname) {
|
if !path_is_dylib(fname) {
|
||||||
// Finally, set the correct .interp for binaries
|
// Finally, set the correct .interp for binaries
|
||||||
let dynamic_linker_path = nix_deps_dir.join("nix-support/dynamic-linker");
|
let dynamic_linker_path = nix_deps_dir.join("nix-support/dynamic-linker");
|
||||||
|
Loading…
Reference in New Issue
Block a user