Skip to content

Commit

Permalink
Add local LLD to the PATH for run-make-fulldeps tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Apr 30, 2019
1 parent c95f5e3 commit 7acead5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/bootstrap/test.rs
Expand Up @@ -1238,6 +1238,21 @@ impl Step for Compiletest {
.expect("Expected llvm-config to be contained in directory");
assert!(llvm_bin_path.is_dir());
cmd.arg("--llvm-bin-dir").arg(llvm_bin_path);

// If LLD is available, add it to the PATH
if builder.config.lld_enabled {
let lld_install_root = builder.ensure(native::Lld {
target: builder.config.build,
});

let lld_bin_path = lld_install_root.join("bin");

let old_path = env::var_os("PATH").unwrap_or_default();
let new_path = env::join_paths(std::iter::once(lld_bin_path)
.chain(env::split_paths(&old_path)))
.expect("Could not add LLD bin path to PATH");
cmd.env("PATH", new_path);
}
}
}

Expand Down

0 comments on commit 7acead5

Please sign in to comment.