Rollup merge of #53950 - michaelwoerister:more-lto-cli, r=alexcrichton
Allow for opting out of ThinLTO and clean up LTO related cli flag handling. It turns out that there currently is no way to explicitly disable ThinLTO (except for the nightly-only `-Zthinlto` flag). This PR extends `-C lto` to take `yes` and `no` in addition to `thin` and `fat`. It should be backwards compatible. It also cleans up how LTO mode selection is handled. Note that merging the PR in the current state would make the new values for `-C lto` available on the stable channel. I think that would be fine but maybe some team should vote on it.
This commit is contained in:
commit
07dc4b3759
8 changed files with 97 additions and 32 deletions
|
@ -937,7 +937,6 @@ fn need_pre_thin_lto_bitcode_for_incr_comp(sess: &Session) -> bool {
|
|||
}
|
||||
|
||||
match sess.lto() {
|
||||
Lto::Yes |
|
||||
Lto::Fat |
|
||||
Lto::No => false,
|
||||
Lto::Thin |
|
||||
|
@ -1372,7 +1371,7 @@ fn execute_optimize_work_item(cgcx: &CodegenContext,
|
|||
// require LTO so the request for LTO is always unconditionally
|
||||
// passed down to the backend, but we don't actually want to do
|
||||
// anything about it yet until we've got a final product.
|
||||
Lto::Yes | Lto::Fat | Lto::Thin => {
|
||||
Lto::Fat | Lto::Thin => {
|
||||
cgcx.crate_types.len() != 1 ||
|
||||
cgcx.crate_types[0] != config::CrateType::Rlib
|
||||
}
|
||||
|
@ -1552,7 +1551,7 @@ fn start_executing_work(tcx: TyCtxt,
|
|||
exported_symbols.insert(LOCAL_CRATE, copy_symbols(LOCAL_CRATE));
|
||||
Some(Arc::new(exported_symbols))
|
||||
}
|
||||
Lto::Yes | Lto::Fat | Lto::Thin => {
|
||||
Lto::Fat | Lto::Thin => {
|
||||
exported_symbols.insert(LOCAL_CRATE, copy_symbols(LOCAL_CRATE));
|
||||
for &cnum in tcx.crates().iter() {
|
||||
exported_symbols.insert(cnum, copy_symbols(cnum));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue