Skip to content

Commit f2969ed

Browse files
Set 'PrepareForThinLTO' whenever doing cross-language LTO.
1 parent 3742f4d commit f2969ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_codegen_llvm/back/write.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ unsafe fn optimize(cgcx: &CodegenContext,
552552
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
553553
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
554554
let opt_level = config.opt_level.unwrap_or(llvm::CodeGenOptLevel::None);
555-
let prepare_for_thin_lto = cgcx.lto == Lto::Thin || cgcx.lto == Lto::ThinLocal;
555+
let prepare_for_thin_lto = cgcx.lto == Lto::Thin || cgcx.lto == Lto::ThinLocal ||
556+
(cgcx.lto != Lto::Fat && cgcx.opts.debugging_opts.cross_lang_lto.enabled());
556557
have_name_anon_globals_pass = have_name_anon_globals_pass || prepare_for_thin_lto;
557558
if using_thin_buffers && !prepare_for_thin_lto {
558559
assert!(addpass("name-anon-globals"));

0 commit comments

Comments
 (0)