]> git.lizzy.rs Git - rust.git/commitdiff
Inline crt-static choice for pc-windows-msvc
authorSamuel Holland <samuel@sholland.org>
Tue, 22 Aug 2017 21:24:29 +0000 (16:24 -0500)
committerSamuel Holland <samuel@sholland.org>
Tue, 22 Aug 2017 21:24:29 +0000 (16:24 -0500)
This avoids the possibility of a duplicate or conflicting crt-static
command line option sent to rustc.

src/bootstrap/bin/rustc.rs
src/bootstrap/lib.rs

index d098806a8a002de9dd39f9a0921a0fa466eca382..0baca9e58f4fe2e753b0f7907647a1cdf91ab968 100644 (file)
@@ -237,11 +237,6 @@ fn main() {
             }
         }
 
-        if target.contains("pc-windows-msvc") {
-            cmd.arg("-Z").arg("unstable-options");
-            cmd.arg("-C").arg("target-feature=+crt-static");
-        }
-
         if let Ok(s) = env::var("RUSTC_CRT_STATIC") {
             if s == "true" {
                 cmd.arg("-C").arg("target-feature=+crt-static");
index d6afc562f3dc894a27b66547f1da06e6c8b5545d..55358f2ffcb7334deda2c7e4ecde1180cdd9c7d6 100644 (file)
@@ -658,8 +658,12 @@ fn rustc_flags(&self, target: Interned<String>) -> Vec<String> {
 
     /// Returns if this target should statically link the C runtime, if specified
     fn crt_static(&self, target: Interned<String>) -> Option<bool> {
-        self.config.target_config.get(&target)
-            .and_then(|t| t.crt_static)
+        if target.contains("pc-windows-msvc") {
+            Some(true)
+        } else {
+            self.config.target_config.get(&target)
+                .and_then(|t| t.crt_static)
+        }
     }
 
     /// Returns the "musl root" for this `target`, if defined