about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Gilcher <florian.gilcher@asquera.de>2014-09-12 13:26:21 +0200
committerFlorian Gilcher <florian.gilcher@asquera.de>2014-09-15 07:12:52 +0200
commite9c4efb1bf00594c06bf694efe2f68c9633ed18b (patch)
tree6b796ed591fe8d2c5e00f2eef0f80bd983f35fae
parent793a36617bdaec4ffb3fc0e8b1fb44d0b633ed5c (diff)
downloadrust-e9c4efb1bf00594c06bf694efe2f68c9633ed18b.tar.gz
rust-e9c4efb1bf00594c06bf694efe2f68c9633ed18b.zip
Only pass -fno-use-linker-plugin on Windows
Only pass -fno-use-linker-plugin on Windows where it avoids pulling in
dependencies. Passing it to clang on OS X and Linux would make it fail
though.
-rw-r--r--src/librustc/back/link.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index 77a837bfbb1..cc4e47de007 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -931,7 +931,12 @@ fn link_args(cmd: &mut Command,
     }
 
     // Rust does its' own LTO
-    cmd.arg("-fno-lto").arg("-fno-use-linker-plugin");
+    cmd.arg("-fno-lto");
+
+    // clang fails hard if -fno-use-linker-plugin is passed
+    if sess.targ_cfg.os == abi::OsWindows {
+        cmd.arg("-fno-use-linker-plugin");
+    }
 
     // If we're building a dylib, we don't use --gc-sections because LLVM has
     // already done the best it can do, and we also don't want to eliminate the