about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorXimin Luo <infinity0@pwned.gg>2021-04-11 14:02:28 +0100
committerXimin Luo <infinity0@pwned.gg>2021-04-11 14:02:28 +0100
commitbe5d72129e33d2cadb7fa003395eccd986447833 (patch)
treef1be03557f71c1f4f5f180e883e992508f20e31f /src
parent58f32da346642ff3f50186f6f4a0de46e61008be (diff)
downloadrust-be5d72129e33d2cadb7fa003395eccd986447833.tar.gz
rust-be5d72129e33d2cadb7fa003395eccd986447833.zip
bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/compile.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 8244c7710ab..66a88e85fea 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -462,11 +462,13 @@ impl Step for StartupObjects {
             let dst_file = &dst_dir.join(file.to_string() + ".o");
             if !up_to_date(src_file, dst_file) {
                 let mut cmd = Command::new(&builder.initial_rustc);
+                cmd.env("RUSTC_BOOTSTRAP", "1");
+                if !builder.local_rebuild {
+                    // a local_rebuild compiler already has stage1 features
+                    cmd.arg("--cfg").arg("bootstrap");
+                }
                 builder.run(
-                    cmd.env("RUSTC_BOOTSTRAP", "1")
-                        .arg("--cfg")
-                        .arg("bootstrap")
-                        .arg("--target")
+                    cmd.arg("--target")
                         .arg(target.rustc_target_arg())
                         .arg("--emit=obj")
                         .arg("-o")