qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"David Hildenbrand" <david@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-s390x@nongnu.org, "Beraldo Leal" <bleal@redhat.com>,
	qemu-arm@nongnu.org, devel@lists.libvirt.org,
	qemu-ppc@nongnu.org,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Marek Vasut" <marex@denx.de>, "Thomas Huth" <thuth@redhat.com>,
	"Chris Wulff" <crwulff@gmail.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Nicholas Piggin" <npiggin@gmail.com>
Subject: [PATCH v2 13/14] configure: don't try a "native" cross for linux-user
Date: Mon, 20 Nov 2023 15:08:32 +0000	[thread overview]
Message-ID: <20231120150833.2552739-14-alex.bennee@linaro.org> (raw)
In-Reply-To: <20231120150833.2552739-1-alex.bennee@linaro.org>

As 32 bit x86 become rarer we are starting to run into problems with
search paths. Although we switched to a Debian container we still
favour the native CC on a Bookworm host. As a result we have a broken
cross compile setup which then fails to build with:

    BUILD   i386-linux-user guest-tests
  In file included from /usr/include/linux/stat.h:5,
                   from /usr/include/bits/statx.h:31,
                   from /usr/include/sys/stat.h:465,
                   from /home/alex/lsrc/qemu.git/tests/tcg/multiarch/linux/linux-test.c:28:
  /usr/include/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
      5 | #include <asm/types.h>
        |          ^~~~~~~~~~~~~
  compilation terminated.
  make[1]: *** [Makefile:119: linux-test] Error 1
  make: *** [/home/alex/lsrc/qemu.git/tests/Makefile.include:50: build-tcg-tests-i386-linux-user] Error 2

This is likely to affect more and more linux-user builds so wrap the
whole check in a test for softmmu targets (aka bare metal) which don't
worry about such header niceties. This allows us to keep using the
host compiler for softmmu tests and the roms.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2
  - split fix for tests/docker: replace fedora-i386 with debian-i686
    as still in my tree ;-)
  - didn't apply dpb rb due to change requested by bonzini
---
 configure | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/configure b/configure
index 9ea0bf5698..42fe4d0510 100755
--- a/configure
+++ b/configure
@@ -1391,16 +1391,19 @@ probe_target_compiler() {
   done
 
   try=cross
-  case "$target_arch:$cpu" in
-    aarch64_be:aarch64 | \
-    armeb:arm | \
-    i386:x86_64 | \
-    mips*:mips64 | \
-    ppc*:ppc64 | \
-    sparc:sparc64 | \
-    "$cpu:$cpu")
-      try='native cross' ;;
-  esac
+  # For softmmu/roms we might be able to use the host compiler
+  if [ "${1%softmmu}" != "$1" ]; then
+      case "$target_arch:$cpu" in
+        aarch64_be:aarch64 | \
+        armeb:arm | \
+        i386:x86_64 | \
+        mips*:mips64 | \
+        ppc*:ppc64 | \
+        sparc:sparc64 | \
+        "$cpu:$cpu")
+        try='native cross' ;;
+      esac
+  fi
   eval "target_cflags=\${cross_cc_cflags_$target_arch}"
   for thistry in $try; do
     case $thistry in
-- 
2.39.2



  parent reply	other threads:[~2023-11-20 15:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 15:08 [PATCH v2 00/14] random fixes for 8.2 pre-PR (tests, plugins, docs, semihosting) Alex Bennée
2023-11-20 15:08 ` [PATCH v2 01/14] tests/docker: replace fedora-i386 with debian-i686 Alex Bennée
2023-11-20 15:08 ` [PATCH v2 02/14] .gitlab-ci.d/cirrus: Upgrade macOS to 13 (Ventura) Alex Bennée
2023-11-20 15:08 ` [PATCH v2 03/14] tests/docker: merge debian-native with debian-amd64 Alex Bennée
2023-11-20 15:08 ` [PATCH v2 04/14] plugins: fix win plugin tests on cross compile Alex Bennée
2023-11-20 15:08 ` [PATCH v2 05/14] target/nios2: Deprecate the Nios II architecture Alex Bennée
2023-11-20 15:08 ` [PATCH v2 06/14] tests/tcg: fixup Aarch64 semiconsole test Alex Bennée
2023-11-20 15:08 ` [PATCH v2 07/14] docs/emulation: expand warning about semihosting Alex Bennée
2023-11-20 16:15   ` Richard Henderson
2023-11-20 15:08 ` [PATCH v2 08/14] docs/system: clarify limits of using gdbstub in system emulation Alex Bennée
2023-11-20 16:15   ` Richard Henderson
2023-11-20 17:20   ` Philippe Mathieu-Daudé
2023-11-20 17:26   ` Peter Maydell
2023-11-20 15:08 ` [PATCH v2 09/14] hw/core: skip loading debug on all failures Alex Bennée
2023-11-20 15:08 ` [PATCH v2 10/14] testing: move arm system tests into their own folder Alex Bennée
2023-11-20 15:08 ` [PATCH v2 11/14] tests/tcg: enable arm softmmu tests Alex Bennée
2023-11-20 16:32   ` Richard Henderson
2023-11-20 17:25   ` Peter Maydell
2023-11-20 15:08 ` [PATCH v2 12/14] tests/tcg: enable semiconsole test for Arm Alex Bennée
2023-11-20 15:08 ` Alex Bennée [this message]
2023-11-20 15:08 ` [PATCH v2 14/14] tests/tcg: finesse the registers check for "hidden" regs Alex Bennée

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=20231120150833.2552739-14-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=bleal@redhat.com \
    --cc=clg@kaod.org \
    --cc=crwulff@gmail.com \
    --cc=danielhb413@gmail.com \
    --cc=david@redhat.com \
    --cc=devel@lists.libvirt.org \
    --cc=erdnaxe@crans.org \
    --cc=iii@linux.ibm.com \
    --cc=ma.mandourr@gmail.com \
    --cc=marex@denx.de \
    --cc=npiggin@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).