[lld] [lld-macho] Disable static assert failing on several platforms (PR #107514)

Daniel Bertalan via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 01:07:24 PDT 2024


BertalanD wrote:

I think the issue is that Windows targets only "merge" bit fields when the underlying types have the same size. Can someone check that this fixes the issue?

```diff
diff --git a/lld/MachO/Symbols.h b/lld/MachO/Symbols.h
index 70fd195f25c9..bfb777b86621 100644
--- a/lld/MachO/Symbols.h
+++ b/lld/MachO/Symbols.h
@@ -14,6 +14,7 @@
 #include "Target.h"
 
 #include "llvm/Object/Archive.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 
 namespace lld {
@@ -152,7 +153,8 @@ public:
   // Whether this symbol should appear in the output symbol table.
   bool includeInSymtab : 1;
   // The ICF folding kind of this symbol: None / Body / Thunk.
-  ICFFoldKind identicalCodeFoldingKind : 2;
+  LLVM_PREFERRED_TYPE(FoldingKind)
+  uint8_t identicalCodeFoldingKind : 2;
   // Symbols marked referencedDynamically won't be removed from the output's
   // symbol table by tools like strip. In theory, this could be set on arbitrary
   // symbols in input object files. In practice, it's used solely for the
```

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


More information about the llvm-commits mailing list