diff options
| author | bors <bors@rust-lang.org> | 2018-07-05 06:44:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-05 06:44:16 +0000 |
| commit | 6fc21e55766bbcdb0279e6f8a63bdc9859b6e0fc (patch) | |
| tree | adffa6ef66cfad894f8bfadc93c327ae59ee235c /src/bootstrap | |
| parent | c865d3934cbcf5c0d77d955a73711bd3700a57c7 (diff) | |
| parent | 31ed5c7a01d9826c10bdd166ffcd23efd95b1efe (diff) | |
| download | rust-6fc21e55766bbcdb0279e6f8a63bdc9859b6e0fc.tar.gz rust-6fc21e55766bbcdb0279e6f8a63bdc9859b6e0fc.zip | |
Auto merge of #51936 - japaric:rust-lld, r=alexcrichton
rename rustc's lld to rust-lld to not shadow the system installed LLD when linking with LLD. Before: - `-C linker=lld -Z linker-flavor=ld.lld` uses rustc's LLD - It's not possible to use a system installed LLD that's named `lld` With this commit: - `-C linker=rust-lld -Z linker-flavor=ld.lld` uses rustc's LLD - `-C linker=lld -Z linker-flavor=ld.lld` uses the system installed LLD we don't offer guarantees about the availability of LLD in the rustc sysroot so we can rename the tool as long as we don't break the wasm32-unknown-unknown target which depends on it. r? @alexcrichton we discussed this before
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/compile.rs | 7 | ||||
| -rw-r--r-- | src/bootstrap/dist.rs | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index aef2df3e278..298bd58c6cd 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -821,8 +821,11 @@ fn copy_lld_to_sysroot(builder: &Builder, .join("bin"); t!(fs::create_dir_all(&dst)); - let exe = exe("lld", &target); - builder.copy(&lld_install_root.join("bin").join(&exe), &dst.join(&exe)); + let src_exe = exe("lld", &target); + let dst_exe = exe("rust-lld", &target); + // we prepend this bin directory to the user PATH when linking Rust binaries. To + // avoid shadowing the system LLD we rename the LLD we provide to `rust-lld`. + builder.copy(&lld_install_root.join("bin").join(&src_exe), &dst.join(&dst_exe)); } /// Cargo's output path for the standard library in a given stage, compiled diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 19a2c94dca7..0da9611a5a9 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -493,12 +493,13 @@ impl Step for Rustc { // Copy over lld if it's there if builder.config.lld_enabled { - let exe = exe("lld", &compiler.host); + let exe = exe("rust-lld", &compiler.host); let src = builder.sysroot_libdir(compiler, host) .parent() .unwrap() .join("bin") .join(&exe); + // for the rationale about this rename check `compile::copy_lld_to_sysroot` let dst = image.join("lib/rustlib") .join(&*host) .join("bin") |
