]> git.lizzy.rs Git - rust.git/commitdiff
bootstrap: pass crt-static for the compiler host as well
authorJohannes Nixdorf <mixi@exherbo.org>
Sun, 29 Apr 2018 09:21:47 +0000 (11:21 +0200)
committerJohannes Nixdorf <mixi@exherbo.org>
Sun, 29 Apr 2018 09:30:56 +0000 (11:30 +0200)
src/bootstrap/bin/rustc.rs
src/bootstrap/builder.rs

index b6ae824c376017e740d086bade325ed36847ba55..05fe7753720ccb6d966bf34e737425569fc47262 100644 (file)
@@ -261,6 +261,15 @@ fn main() {
         if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
             cmd.arg(format!("-Clinker={}", host_linker));
         }
+
+        if let Ok(s) = env::var("RUSTC_HOST_CRT_STATIC") {
+            if s == "true" {
+                cmd.arg("-C").arg("target-feature=+crt-static");
+            }
+            if s == "false" {
+                cmd.arg("-C").arg("target-feature=-crt-static");
+            }
+        }
     }
 
     if env::var_os("RUSTC_PARALLEL_QUERIES").is_some() {
index 08bb8ab481513bbf803f3a657442cef390c0907f..4e0f71086a372e230055704468a75f78efc69941 100644 (file)
@@ -663,6 +663,10 @@ pub fn cargo(&self,
             cargo.env("RUSTC_CRT_STATIC", x.to_string());
         }
 
+        if let Some(x) = self.crt_static(compiler.host) {
+            cargo.env("RUSTC_HOST_CRT_STATIC", x.to_string());
+        }
+
         // Enable usage of unstable features
         cargo.env("RUSTC_BOOTSTRAP", "1");
         self.add_rust_test_threads(&mut cargo);