From ac29809940ca0d1ffb864975fea2d61a3d649b8d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 15 Aug 2019 13:57:09 -0700 Subject: [PATCH] bootstrap: Move `RUSTC_CRT_STATIC` to `builder.rs` --- src/bootstrap/bin/rustc.rs | 9 ++------- src/bootstrap/builder.rs | 6 +++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index 60f4b98d9d8..c6ac03baefd 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -232,13 +232,8 @@ fn main() { } } - if let Ok(s) = env::var("RUSTC_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 let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") { + cmd.arg("--remap-path-prefix").arg(&map); } } else { // Override linker if necessary. diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 3995ab170d1..e25c4d065cf 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -945,7 +945,11 @@ impl<'a> Builder<'a> { } if let Some(x) = self.crt_static(target) { - cargo.env("RUSTC_CRT_STATIC", x.to_string()); + if x { + rustflags.arg("-Ctarget-feature=+crt-static"); + } else { + rustflags.arg("-Ctarget-feature=-crt-static"); + } } if let Some(x) = self.crt_static(compiler.host) {