Skip to content

Commit 8e6b563

Browse files
committed
rustbuild: Build tests with LLD if use-lld = true was passed (non-msvc)
1 parent 77d11c3 commit 8e6b563

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bootstrap/test.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,16 @@ impl Step for Compiletest {
10671067

10681068
let mut hostflags = flags.clone();
10691069
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
1070+
if builder.config.use_lld && !compiler.host.triple.contains("msvc") {
1071+
hostflags.push("-Clink-args=-fuse-ld=lld".to_string());
1072+
}
10701073
cmd.arg("--host-rustcflags").arg(hostflags.join(" "));
10711074

10721075
let mut targetflags = flags;
10731076
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
1077+
if builder.config.use_lld && !target.contains("msvc") {
1078+
targetflags.push("-Clink-args=-fuse-ld=lld".to_string());
1079+
}
10741080
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
10751081

10761082
cmd.arg("--docck-python").arg(builder.python());

0 commit comments

Comments
 (0)