On 03/02/2025 04.18, Richard Henderson wrote:
Define TARGET_LONG_BITS in each target's configure fragment.
Do this without removing the define in target/*/cpu-param.h
so that errors are caught like so:

In file included from .../src/include/exec/cpu-defs.h:26,
                  from ../src/target/hppa/cpu.h:24,
                  from ../src/linux-user/qemu.h:4,
                  from ../src/linux-user/hppa/cpu_loop.c:21:
../src/target/hppa/cpu-param.h:11: error: "TARGET_LONG_BITS" redefined [-Werror]
    11 | #define TARGET_LONG_BITS              64
       |
In file included from .../src/include/qemu/osdep.h:36,
                  from ../src/linux-user/hppa/cpu_loop.c:20:
./hppa-linux-user-config-target.h:32: note: this is the location of the 
previous definition
    32 | #define TARGET_LONG_BITS 32
       |
cc1: all warnings being treated as errors

Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
[...]> diff --git a/configs/targets/hppa-linux-user.mak b/configs/targets/hppa-linux-user.mak
index 8e0a80492f..4295cf384e 100644
--- a/configs/targets/hppa-linux-user.mak
+++ b/configs/targets/hppa-linux-user.mak
@@ -3,3 +3,5 @@ TARGET_ABI32=y
  TARGET_SYSTBL_ABI=common,32
  TARGET_SYSTBL=syscall.tbl
  TARGET_BIG_ENDIAN=y
+# Compromise to ease maintainence vs system mode

s/maintainence/maintenance/

diff --git a/configs/targets/mipsn32-linux-user.mak 
b/configs/targets/mipsn32-linux-user.mak
index 206095da64..39ae214633 100644
--- a/configs/targets/mipsn32-linux-user.mak
+++ b/configs/targets/mipsn32-linux-user.mak
@@ -5,3 +5,4 @@ TARGET_BASE_ARCH=mips
  TARGET_SYSTBL_ABI=n32
  TARGET_SYSTBL=syscall_n32.tbl
  TARGET_BIG_ENDIAN=y
+TARGET_LONG_BITS=64

Why is this 64 ?

diff --git a/configs/targets/mipsn32el-linux-user.mak 
b/configs/targets/mipsn32el-linux-user.mak
index ca2a3ed753..d9b61d6990 100644
--- a/configs/targets/mipsn32el-linux-user.mak
+++ b/configs/targets/mipsn32el-linux-user.mak
@@ -4,3 +4,4 @@ TARGET_ABI32=y
  TARGET_BASE_ARCH=mips
  TARGET_SYSTBL_ABI=n32
  TARGET_SYSTBL=syscall_n32.tbl
+TARGET_LONG_BITS=64

dito?

diff --git a/configs/targets/sparc32plus-linux-user.mak 
b/configs/targets/sparc32plus-linux-user.mak
index 6cc8fa516b..7a16934fd1 100644
--- a/configs/targets/sparc32plus-linux-user.mak
+++ b/configs/targets/sparc32plus-linux-user.mak
@@ -5,3 +5,4 @@ TARGET_ABI_DIR=sparc
  TARGET_SYSTBL_ABI=common,32
  TARGET_SYSTBL=syscall.tbl
  TARGET_BIG_ENDIAN=y
+TARGET_LONG_BITS=64

Same question here: Why 64? If this isn't a mistake, could you maybe add a comment?

 Thanks,
  Thomas


Reply via email to