diff options
| -rw-r--r-- | src/bootstrap/test.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 8082e2468c5..38027aded9c 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -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); + } } } |
