Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename rustc's lld to rust-lld #51936

Merged
merged 2 commits into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,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
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,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")
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_target/spec/wasm32_unknown_unknown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ pub fn target() -> Result<Target, String> {
// no dynamic linking, no need for default visibility!
default_hidden_visibility: true,

// we use the LLD shipped with the Rust toolchain by default
linker: Some("rust-lld".to_owned()),

.. Default::default()
};
Ok(Target {
Expand Down