Don't run LTO passes in rustc when cross-lang LTO is enabled.

This commit is contained in:
Michael Woerister 2018-04-20 15:46:47 +02:00
parent a21fb3f8da
commit 34e658ebd8

View file

@ -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 {