Skip to content

Commit

Permalink
Don't run LTO passes in rustc when cross-lang LTO is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed May 3, 2018
1 parent a21fb3f commit 34e658e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_trans/back/write.rs
Expand Up @@ -1356,6 +1356,10 @@ fn execute_work_item(cgcx: &CodegenContext,
// settings.
let needs_lto = needs_lto && mtrans.kind != ModuleKind::Metadata;

// Don't run LTO passes when cross-lang LTO is enabled. The linker
// will do that for us in this case.
let needs_lto = needs_lto && !cgcx.opts.debugging_opts.cross_lang_lto;

if needs_lto {
Ok(WorkItemResult::NeedsLTO(mtrans))
} else {
Expand Down

0 comments on commit 34e658e

Please sign in to comment.