about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-06 04:00:56 +0000
committerbors <bors@rust-lang.org>2020-09-06 04:00:56 +0000
commitb40abfd4854ec7323a2b6d39356fca2363ed5631 (patch)
tree5b98a9d2159ab2dfd518aabde1021e883569b802 /src
parent94b8eb80abf68d7505aca3562a625ec00fa394a1 (diff)
parenta2fbf39cc8b619ac5b469afd43d0ff8b520511aa (diff)
downloadrust-b40abfd4854ec7323a2b6d39356fca2363ed5631.tar.gz
rust-b40abfd4854ec7323a2b6d39356fca2363ed5631.zip
Auto merge of #76326 - mati865:use_lld-no-linker, r=Mark-Simulacrum
Fix rust.use-lld when linker is not set

Fixes https://github.com/rust-lang/rust/pull/76127#issuecomment-685419195

Previously when `[<target>].linker` was not configured `rust.use-lld` would set it to `rust-lld` on platforms where it should not.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/lib.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 54651214363..1b655f55fb0 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -863,7 +863,12 @@ impl Build {
             && !target.contains("msvc")
         {
             Some(self.cc(target))
-        } else if can_use_lld && self.config.use_lld && self.build == target {
+        } else if target.contains("msvc")
+            && can_use_lld
+            && self.config.use_lld
+            && self.build == target
+        {
+            // Currently we support using LLD directly via `rust.use_lld` option only with MSVC
             Some(&self.initial_lld)
         } else {
             None