Skip to content

Commit 34e658e

Browse files
Don't run LTO passes in rustc when cross-lang LTO is enabled.
1 parent a21fb3f commit 34e658e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_trans/back/write.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,10 @@ fn execute_work_item(cgcx: &CodegenContext,
13561356
// settings.
13571357
let needs_lto = needs_lto && mtrans.kind != ModuleKind::Metadata;
13581358

1359+
// Don't run LTO passes when cross-lang LTO is enabled. The linker
1360+
// will do that for us in this case.
1361+
let needs_lto = needs_lto && !cgcx.opts.debugging_opts.cross_lang_lto;
1362+
13591363
if needs_lto {
13601364
Ok(WorkItemResult::NeedsLTO(mtrans))
13611365
} else {

0 commit comments

Comments
 (0)