On 8/21/25 00:21, Philippe Mathieu-Daudé wrote:
Similarly noted in libunwind: https://reviews.llvm.org/D38110#895887,
when _ABIO32 / _ABIN32 / _ABI64 are not defined (like on OpenBSD) we
get:
[666/1234] Compiling C object libsystem.a.p/tcg_tcg-common.c.o
In file included from ../tcg/tcg-common.c:26:
In file included from include/tcg/tcg.h:34:
tcg/mips/tcg-target-reg-bits.h:10:18: warning: '_ABIO32' is not defined,
evaluates to 0 [-Wundef]
#if _MIPS_SIM == _ABIO32
^
tcg/mips/tcg-target-reg-bits.h:12:20: warning: '_ABIN32' is not defined,
evaluates to 0 [-Wundef]
#elif _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
^
2 warnings generated.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
tcg/mips/tcg-target-reg-bits.h | 5 +++--
tcg/mips/tcg-target.c.inc | 5 +++--
common-user/host/mips/safe-syscall.inc.S | 4 ++--
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/tcg/mips/tcg-target-reg-bits.h b/tcg/mips/tcg-target-reg-bits.h
index 56fe0a725e9..a957d2312f3 100644
--- a/tcg/mips/tcg-target-reg-bits.h
+++ b/tcg/mips/tcg-target-reg-bits.h
@@ -7,9 +7,10 @@
#ifndef TCG_TARGET_REG_BITS_H
#define TCG_TARGET_REG_BITS_H
-#if _MIPS_SIM == _ABIO32
+#if defined(_ABIO32) && _MIPS_SIM == _ABIO32
# define TCG_TARGET_REG_BITS 32
-#elif _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
+#elif (defined(_ABIN32) && _MIPS_SIM == _ABIN32) \
+ || (defined(_ABI64) && _MIPS_SIM == _ABI64)
# define TCG_TARGET_REG_BITS 64
#else
# error "Unknown ABI"
Alternately, remove all of this. If we're removing 32-bit hosts, _ABI64 is the only valid
answer (N32 has 64-bit registers but 32-bit pointers).
r~