Skip to content

Commit 938d4ff

Browse files
committed
Auto merge of #60313 - cuviper:thinlto-import, r=alexcrichton
Limit internalization in LLVM 8 ThinLTO Fixes #60184. r? @alexcrichton
2 parents a9c8c08 + b4131e2 commit 938d4ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rustllvm/PassWrapper.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
873873
return PrevailingType::Unknown;
874874
};
875875
#if LLVM_VERSION_GE(8, 0)
876+
// We don't have a complete picture in our use of ThinLTO, just our immediate
877+
// crate, so we need `ImportEnabled = false` to limit internalization.
878+
// Otherwise, we sometimes lose `static` values -- see #60184.
876879
computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols,
877-
deadIsPrevailing, /* ImportEnabled = */ true);
880+
deadIsPrevailing, /* ImportEnabled = */ false);
878881
#else
879882
computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing);
880883
#endif

0 commit comments

Comments
 (0)