diff options
| author | DianQK <dianqk@dianqk.net> | 2024-06-19 21:20:38 +0800 |
|---|---|---|
| committer | DianQK <dianqk@dianqk.net> | 2024-06-19 22:33:58 +0800 |
| commit | 4281c2c3d5b6fe4ef4c6cf659c20da42209f2289 (patch) | |
| tree | 74529f9b80e4ceccecc25a2a545c59063d658d6a /src/bootstrap/bootstrap.py | |
| parent | 3186d17d56f9803b739a2c0aabd23aafd8791485 (diff) | |
| download | rust-4281c2c3d5b6fe4ef4c6cf659c20da42209f2289.tar.gz rust-4281c2c3d5b6fe4ef4c6cf659c20da42209f2289.zip | |
patch `rust-lld` and `ld.lld` on NixOS
Diffstat (limited to 'src/bootstrap/bootstrap.py')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 9861121aac0..7e47b373ff9 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -617,6 +617,9 @@ class RustBuild(object): self.fix_bin_or_dylib("{}/bin/rustdoc".format(bin_root)) self.fix_bin_or_dylib("{}/libexec/rust-analyzer-proc-macro-srv".format(bin_root)) lib_dir = "{}/lib".format(bin_root) + rustlib_bin_dir = "{}/rustlib/{}/bin".format(lib_dir, self.build) + self.fix_bin_or_dylib("{}/rust-lld".format(rustlib_bin_dir)) + self.fix_bin_or_dylib("{}/gcc-ld/ld.lld".format(rustlib_bin_dir)) for lib in os.listdir(lib_dir): # .so is not necessarily the suffix, there can be version numbers afterwards. if ".so" in lib: @@ -731,12 +734,9 @@ class RustBuild(object): patchelf = "{}/bin/patchelf".format(nix_deps_dir) rpath_entries = [ - # Relative default, all binary and dynamic libraries we ship - # appear to have this (even when `../lib` is redundant). - "$ORIGIN/../lib", os.path.join(os.path.realpath(nix_deps_dir), "lib") ] - patchelf_args = ["--set-rpath", ":".join(rpath_entries)] + patchelf_args = ["--add-rpath", ":".join(rpath_entries)] if ".so" not in fname: # Finally, set the correct .interp for binaries with open("{}/nix-support/dynamic-linker".format(nix_deps_dir)) as dynamic_linker: |
