Auto merge of #84095 - infinity0:master, r=Mark-Simulacrum

bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057
This commit is contained in:
bors 2021-04-12 08:03:59 +00:00
commit 67e402f946

View File

@ -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")