Skip to content

Commit e1a7743

Browse files
authored
Rollup merge of #92516 - Kobzol:bootstrap-symbol-mangling, r=Mark-Simulacrum
Do not use deprecated -Zsymbol-mangling-version in bootstrap `-Zsymbol-mangling-version` now produces warnings unconditionally. So if you want to use legacy mangling for the compiler (`new-symbol-mangling = false` in `config.toml`), the build is now littered with warnings. However, with this change, stage 1 `std` doesn't compile: ``` error: `-C symbol-mangling-version=legacy` requires `-Z unstable-options` ``` Even after the bootstrap compiler is updated and it will support `-Csymbol-mangling-version`, the bootstrap code would either need to use `-Z` for the legacy mangling or use `-C` in combination with `-Z unstable-options` (because `-C` + legacy is not allowed without the unstable options). Should we just add `-Z unstable-options` to `std` compilation to resolve this? Btw I use legacy mangling because the new mangling is not supported by [Hotspot](https://github.com/KDAB/hotspot).
2 parents b9694a1 + e266cb9 commit e1a7743

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Diff for: src/bootstrap/builder.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -988,10 +988,20 @@ impl<'a> Builder<'a> {
988988
}
989989
};
990990

991-
if use_new_symbol_mangling {
992-
rustflags.arg("-Zsymbol-mangling-version=v0");
991+
// cfg(bootstrap) -- drop the compiler.stage == 0 branch.
992+
if compiler.stage == 0 {
993+
if use_new_symbol_mangling {
994+
rustflags.arg("-Zsymbol-mangling-version=v0");
995+
} else {
996+
rustflags.arg("-Zsymbol-mangling-version=legacy");
997+
}
993998
} else {
994-
rustflags.arg("-Zsymbol-mangling-version=legacy");
999+
if use_new_symbol_mangling {
1000+
rustflags.arg("-Csymbol-mangling-version=v0");
1001+
} else {
1002+
rustflags.arg("-Csymbol-mangling-version=legacy");
1003+
rustflags.arg("-Zunstable-options");
1004+
}
9951005
}
9961006

9971007
// FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,

0 commit comments

Comments
 (0)