Skip to content

Commit be5d721

Browse files
committed
bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057
1 parent 58f32da commit be5d721

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bootstrap/compile.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,13 @@ impl Step for StartupObjects {
462462
let dst_file = &dst_dir.join(file.to_string() + ".o");
463463
if !up_to_date(src_file, dst_file) {
464464
let mut cmd = Command::new(&builder.initial_rustc);
465+
cmd.env("RUSTC_BOOTSTRAP", "1");
466+
if !builder.local_rebuild {
467+
// a local_rebuild compiler already has stage1 features
468+
cmd.arg("--cfg").arg("bootstrap");
469+
}
465470
builder.run(
466-
cmd.env("RUSTC_BOOTSTRAP", "1")
467-
.arg("--cfg")
468-
.arg("bootstrap")
469-
.arg("--target")
471+
cmd.arg("--target")
470472
.arg(target.rustc_target_arg())
471473
.arg("--emit=obj")
472474
.arg("-o")

0 commit comments

Comments
 (0)