Skip to content

Commit 7acead5

Browse files
Add local LLD to the PATH for run-make-fulldeps tests.
1 parent c95f5e3 commit 7acead5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/bootstrap/test.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,21 @@ impl Step for Compiletest {
12381238
.expect("Expected llvm-config to be contained in directory");
12391239
assert!(llvm_bin_path.is_dir());
12401240
cmd.arg("--llvm-bin-dir").arg(llvm_bin_path);
1241+
1242+
// If LLD is available, add it to the PATH
1243+
if builder.config.lld_enabled {
1244+
let lld_install_root = builder.ensure(native::Lld {
1245+
target: builder.config.build,
1246+
});
1247+
1248+
let lld_bin_path = lld_install_root.join("bin");
1249+
1250+
let old_path = env::var_os("PATH").unwrap_or_default();
1251+
let new_path = env::join_paths(std::iter::once(lld_bin_path)
1252+
.chain(env::split_paths(&old_path)))
1253+
.expect("Could not add LLD bin path to PATH");
1254+
cmd.env("PATH", new_path);
1255+
}
12411256
}
12421257
}
12431258

0 commit comments

Comments
 (0)