about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-06-03 11:14:45 -0600
committerMark Rousskov <mark.simulacrum@gmail.com>2019-06-05 17:57:58 -0600
commitbea2e55efac9cd4d40cc37a543dba3f1d1714bd2 (patch)
treeac1e4f4d4cbffa3b243cc47ddb2919da051d960c /src/bootstrap
parent7cdaffd7962c4aae0cadd82baa241901b03f9458 (diff)
downloadrust-bea2e55efac9cd4d40cc37a543dba3f1d1714bd2.tar.gz
rust-bea2e55efac9cd4d40cc37a543dba3f1d1714bd2.zip
Utilize cfg(bootstrap) over cfg(stage0)
Also removes stage1, stage2 cfgs being passed to rustc to ensure that
stage1 and stage2 are only differentiated as a group (i.e., only through
not bootstrap).
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bin/rustc.rs8
-rw-r--r--src/bootstrap/compile.rs2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index d51961c65b7..f5fb6f0b4d0 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -89,12 +89,16 @@ fn main() {
 
     let mut cmd = Command::new(rustc);
     cmd.args(&args)
-        .arg("--cfg")
-        .arg(format!("stage{}", stage))
         .env(bootstrap::util::dylib_path_var(),
              env::join_paths(&dylib_path).unwrap());
     let mut maybe_crate = None;
 
+    // Non-zero stages must all be treated uniformly to avoid problems when attempting to uplift
+    // compiler libraries and such from stage 1 to 2.
+    if stage == "0" {
+        cmd.arg("--cfg").arg("bootstrap");
+    }
+
     // Print backtrace in case of ICE
     if env::var("RUSTC_BACKTRACE_ON_ICE").is_ok() && env::var("RUST_BACKTRACE").is_err() {
         cmd.env("RUST_BACKTRACE", "1");
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 4515c7d672d..c7fa8e788b5 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -341,7 +341,7 @@ impl Step for StartupObjects {
             if !up_to_date(src_file, dst_file) {
                 let mut cmd = Command::new(&builder.initial_rustc);
                 builder.run(cmd.env("RUSTC_BOOTSTRAP", "1")
-                            .arg("--cfg").arg("stage0")
+                            .arg("--cfg").arg("bootstrap")
                             .arg("--target").arg(target)
                             .arg("--emit=obj")
                             .arg("-o").arg(dst_file)