Skip to content

Commit b4131e2

Browse files
committed
Limit internalization in LLVM 8 ThinLTO
1 parent bd31c39 commit b4131e2

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)