diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index f7eb2aecc0d..f56c994523c 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1067,10 +1067,16 @@ impl Step for Compiletest { let mut hostflags = flags.clone(); hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display())); + if builder.config.use_lld && !compiler.host.triple.contains("msvc") { + hostflags.push("-Clink-args=-fuse-ld=lld".to_string()); + } cmd.arg("--host-rustcflags").arg(hostflags.join(" ")); let mut targetflags = flags; targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display())); + if builder.config.use_lld && !target.contains("msvc") { + targetflags.push("-Clink-args=-fuse-ld=lld".to_string()); + } cmd.arg("--target-rustcflags").arg(targetflags.join(" ")); cmd.arg("--docck-python").arg(builder.python());