From 55dab7c82018101709de8cb986cede87effbb50d Mon Sep 17 00:00:00 2001 From: Johannes Nixdorf Date: Sun, 29 Apr 2018 11:21:47 +0200 Subject: [PATCH] bootstrap: pass crt-static for the compiler host as well --- src/bootstrap/bin/rustc.rs | 9 +++++++++ src/bootstrap/builder.rs | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index 6f27402233f..4607ca5cf9f 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -268,6 +268,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() { diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 4fdb36b3f6e..d8a449277ab 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -842,6 +842,10 @@ pub fn cargo( 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); -- 2.44.0