[compiler-rt] [compiler-rt][Mips] Properly guard references to _ABIN32 (PR #124492)

Jens Reidel via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 13:47:25 PST 2025


================
@@ -134,9 +134,10 @@ const int FUTEX_WAKE_PRIVATE = FUTEX_WAKE | FUTEX_PRIVATE_FLAG;
 // Are we using 32-bit or 64-bit Linux syscalls?
 // x32 (which defines __x86_64__) has SANITIZER_WORDSIZE == 32
 // but it still needs to use 64-bit syscalls.
-#  if SANITIZER_LINUX && (defined(__x86_64__) || defined(__powerpc64__) || \
-                          SANITIZER_WORDSIZE == 64 ||                      \
-                          (defined(__mips__) && _MIPS_SIM == _ABIN32))
+#  if SANITIZER_LINUX &&                                \
+      (defined(__x86_64__) || defined(__powerpc64__) || \
+       SANITIZER_WORDSIZE == 64 ||                      \
+       (defined(__mips__) && defined(_ABIN32) && _MIPS_SIM == _ABIN32))
----------------
Gelbpunkt wrote:

Not really. We could replace all uses of `_MIPS_SIM == _ABIN32/_ABIO32/_ABI64`  with `defined(_ABIN32/_ABIO32/_ABI64)`. I thought of that but decided not to do it because the rest of LLVM seems followed the pattern of `defined(_ABIO32) && _MIPS_SIM == _ABIO32` (e.g. libunwind), so I thought it would be less intrusive and match existing style.

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


More information about the llvm-commits mailing list