public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	kvm@vger.kernel.org
Subject: [NOTFORMERGE PATCH 6/6] buildsys: Allow building guest-agent on 32-bit hosts
Date: Wed, 25 Mar 2026 16:17:28 +0100	[thread overview]
Message-ID: <20260325151728.45378-7-philmd@linaro.org> (raw)
In-Reply-To: <20260325151728.45378-1-philmd@linaro.org>

Partially revert commit range 5053e0a65db...90e2e8ada7c.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 configure   | 64 +++++++++++++++++++++++++++++++++++++++++++----------
 meson.build |  2 +-
 2 files changed, 53 insertions(+), 13 deletions(-)

diff --git a/configure b/configure
index eea90306728..e984ec2bd3c 100755
--- a/configure
+++ b/configure
@@ -381,6 +381,8 @@ fi
 if test ! -z "$cpu" ; then
   # command line argument
   :
+elif check_define __i386__ ; then
+  cpu="i386"
 elif check_define __x86_64__ ; then
   if check_define __ILP32__ ; then
     cpu="x32"
@@ -399,22 +401,30 @@ elif check_define _ARCH_PPC64 ; then
   else
     cpu="ppc64"
   fi
-elif check_define __mips64 ; then
-  cpu="mips64"
+elif check_define __mips__ ; then
+  if check_define __mips64 ; then
+    cpu="mips64"
+  fi
 elif check_define __s390__ ; then
   if check_define __s390x__ ; then
     cpu="s390x"
   else
     cpu="s390"
   fi
-elif check_define __riscv && check_define _LP64 ; then
-  cpu="riscv64"
+elif check_define __riscv ; then
+  if check_define _LP64 ; then
+    cpu="riscv64"
+  else
+    cpu="riscv32"
+  fi
+elif check_define __arm__ ; then
+  cpu="arm"
 elif check_define __aarch64__ ; then
   cpu="aarch64"
 elif check_define __loongarch64 ; then
   cpu="loongarch64"
 elif check_define EMSCRIPTEN ; then
-  error_exit "wasm64 must be specified to the cpu flag"
+  error_exit "wasm32 or wasm64 must be specified to the cpu flag"
 else
   # Using uname is really broken, but it is just a fallback for architectures
   # that are going to use TCI anyway
@@ -440,6 +450,18 @@ case "$cpu" in
     linux_arch=arm64
     ;;
 
+  armv*b|armv*l|arm)
+    cpu=arm
+    host_arch=arm
+    ;;
+
+  i386|i486|i586|i686)
+    cpu="i386"
+    host_arch=i386
+    linux_arch=x86
+    CPU_CFLAGS="-m32"
+    ;;
+
   loongarch*)
     cpu=loongarch64
     host_arch=loongarch64
@@ -448,7 +470,7 @@ case "$cpu" in
 
   mips64*|mipsisa64*)
     cpu=mips64
-    host_arch=mips64
+    host_arch=mips
     linux_arch=mips
     ;;
 
@@ -464,8 +486,8 @@ case "$cpu" in
     CPU_CFLAGS="-m64 -mlittle-endian"
     ;;
 
-  riscv64)
-    host_arch=riscv64
+  riscv32 | riscv64)
+    host_arch=riscv
     linux_arch=riscv
     ;;
 
@@ -500,6 +522,9 @@ case "$cpu" in
     linux_arch=x86
     CPU_CFLAGS="-m64"
     ;;
+  wasm32)
+    CPU_CFLAGS="-m32"
+    ;;
   wasm64)
     CPU_CFLAGS="-m64 -sMEMORY64=$wasm64_memory64"
     ;;
@@ -1287,7 +1312,7 @@ EOF
     test "$bigendian" = no && rust_arch=${rust_arch}el
     ;;
 
-  riscv64)
+  riscv32|riscv64)
     # e.g. riscv64gc-unknown-linux-gnu, but riscv64-linux-android
     test "$android" = no && rust_arch=${rust_arch}gc
     ;;
@@ -1449,18 +1474,26 @@ probe_target_compiler() {
         container_image=debian-all-test-cross
         container_cross_prefix=aarch64-linux-gnu-
         ;;
-      alpha|hppa|m68k|mips|riscv64|sh4|sparc64)
+      hppa|m68k|mips|riscv64|sparc64)
         container_image=debian-all-test-cross
         ;;
       mips64)
         container_image=debian-all-test-cross
         container_cross_prefix=mips64-linux-gnuabi64-
         ;;
-      ppc|ppc64|ppc64le)
+      ppc64|ppc64le)
         container_image=debian-all-test-cross
         container_cross_prefix=powerpc${target_arch#ppc}-linux-gnu-
         ;;
 
+      # debian-legacy-test-cross architectures (need Debian 11)
+      # - libc6.1-dev-alpha-cross: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054412
+      # - sh4-linux-user: binaries don't run with bookworm compiler
+
+      alpha|sh4)
+        container_image=debian-legacy-test-cross
+        ;;
+
       # architectures with individual containers
 
       aarch64)
@@ -1930,7 +1963,14 @@ if test "$skip_meson" = no; then
   if test "$cross_compile" = "yes"; then
     echo "[host_machine]" >> $cross
     echo "system = '$host_os'" >> $cross
-    echo "cpu_family = '$cpu'" >> $cross
+    case "$cpu" in
+        i386)
+            echo "cpu_family = 'x86'" >> $cross
+            ;;
+        *)
+            echo "cpu_family = '$cpu'" >> $cross
+            ;;
+    esac
     echo "cpu = '$cpu'" >> $cross
     if test "$bigendian" = "yes" ; then
         echo "endian = 'big'" >> $cross
diff --git a/meson.build b/meson.build
index d7c4095b395..ae412263ec7 100644
--- a/meson.build
+++ b/meson.build
@@ -323,7 +323,7 @@ endif
 # Compiler flags #
 ##################
 
-if cc.sizeof('void *') < 8
+if not have_ga and cc.sizeof('void *') < 8
   error('QEMU requires a 64-bit CPU host architecture')
 endif
 
-- 
2.53.0



  parent reply	other threads:[~2026-03-25 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 15:17 [PATCH-for-11.0? 0/6] qom: Restrict compat properties API to system emulation Philippe Mathieu-Daudé
2026-03-25 15:17 ` [PATCH-for-11.0? 1/6] MAINTAINERS: Separate QDev section from QOM one Philippe Mathieu-Daudé
2026-03-25 15:17 ` [PATCH-for-11.0? 2/6] hw/core: Move compat_props_add() to 'hw/core/boards.h' Philippe Mathieu-Daudé
2026-03-25 15:17 ` [PATCH-for-11.0? 3/6] qom: Declare GlobalProperty structure in 'qom/compat-properties.h' Philippe Mathieu-Daudé
2026-03-25 15:17 ` [PATCH-for-11.0? 4/6] qom: Declare compat properties API " Philippe Mathieu-Daudé
2026-03-25 15:17 ` [PATCH-for-11.0? 5/6] qom: Restrict compat properties API to system emulation Philippe Mathieu-Daudé
2026-03-25 15:17 ` Philippe Mathieu-Daudé [this message]
2026-03-26  6:43 ` [PATCH-for-11.0? 0/6] " Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260325151728.45378-7-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox