bootstrap should set optimization level when calculating cflags #48906
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
bootstrap/builder.rs
uses cc-rs to get a list of cflags for the target, which it then passes tocargo build
asCFLAGS_<target>
. As of rust-lang/cc-rs#294, the flags can depend on the optimization level: on iOS, with optimization disabled it passes-fembed-bitcode -fembed-bitcode-marker
, but with optimization enabled it passes only-fembed-bitcode
. However, bootstrap seems to always pass-fembed-bitcode-marker
.Note that some of the crates in the build, such as libcompiler_builtins and libbacktrace, use cc-rs themselves, causing a second set of cflags to be appended to the cc command line, identical except for respecting the optimization level. This seems odd, although it doesn't seem to cause any problems in itself.
Example build log:
The text was updated successfully, but these errors were encountered: