[llvm] Use MapVector to fix lld thinLTO "nondeterminism" issue. (PR #117551)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 1 18:52:02 PST 2024


================
@@ -28,11 +29,11 @@ class RecordStreamer : public MCStreamer {
 
 private:
   const Module &M;
-  StringMap<State> Symbols;
+  MapVector<StringRef, State> Symbols;
----------------
vitalybuka wrote:

To clarify, order is determined by:
1. order and values passed into markDefined/markDefined/markUsed invoked
2. hash table implementation

So for the same lld binary those are consistent, and should not change result.

SymverAliasMap on other hand, also depends on raw pointers values, which controlled by memory allocator, which are very inconsistent, especially with ASLR.

So could you please confirm that `SymverAliasMap` was the root-cause of your issue, and not `Symbols`?

https://github.com/llvm/llvm-project/pull/117551


More information about the llvm-commits mailing list