u-8d504aa90416668d8f6b4cbd449e2e1de20fb937
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Sun, 19 Sep 2021 18:48:33 +0000 (19:48 +0100)
committerXimin Luo <infinity0@debian.org>
Sun, 19 Sep 2021 18:48:33 +0000 (19:48 +0100)
commit 8d504aa90416668d8f6b4cbd449e2e1de20fb937
Bug: https://github.com/rust-lang/rust/issues/84057
Author: Ximin Luo <infinity0@pwned.gg>
Date:   Sun Apr 11 13:47:58 2021 +0100

    bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057

Gbp-Pq: Name u-8d504aa90416668d8f6b4cbd449e2e1de20fb937.patch

src/bootstrap/compile.rs

index 65a2d210a9c6f297bece73a5bed6f082684df2f9..4273238a2f3ecc708b205217fa7b22f661cc2498 100644 (file)
@@ -438,11 +438,14 @@ 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")