From 8e6b563b934c0f5b57b38c57efdd005ed100d64c Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 6 Sep 2020 20:44:50 +0300 Subject: [PATCH] rustbuild: Build tests with LLD if `use-lld = true` was passed (non-msvc) --- src/bootstrap/test.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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 @@ fn run(self, builder: &Builder<'_>) { 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());