qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/2] build: make tests/tcg compiler detection code more generic


From: Paolo Bonzini
Subject: [PATCH 0/2] build: make tests/tcg compiler detection code more generic
Date: Wed, 22 Jun 2022 15:47:40 +0200

Configure is trying to fall back on cross compilers for targets that
can have bi-arch or bi-endian toolchains, but there are many corner
cases where just checking the name can go wrong.  For example, the RHEL
ppc64le compiler is bi-arch and bi-endian, but multilibs are disabled.
Therefore it cannot be used to build 32-bit hosted binaries like the
linux-user TCG tests.

Trying the cross compiler first also does not work, and an example for
this is also ppc64le.  The powerpc64-linux-gnu-gcc binary from the
cross-gcc package is theoretically multilib-friendly, but it cannot
find the CRT files on a ppc64le host, because they are not in the .../le
multilib subdirectory.

This can be fixed by testing both the native compiler and the cross
compiler, and proceeding with the first one that works.  To do this,
move the compiler usability check from the tests/tcg snippet to inside
probe_target_compiler.

While at it, restrict it to just the user-mode emulation tests; if
a compiler is not able to build nostdlib freestanding binaries the
installation is broken.  This however detects a problem with some
system emulation tests that are using inttypes.h instead of stdint.h,
and not passing -ffreestanding to the compiler.  The first patch
fixes that.

Paolo

Based-on: <20220621075147.36297-1-pbonzini@redhat.com>


 configure                              | 166 +++++++++++++++----------
 tests/tcg/Makefile.target              |   1 +
 tests/tcg/aarch64/system/pauth-3.c     |   2 +-
 tests/tcg/aarch64/system/semiconsole.c |   2 +-
 tests/tcg/aarch64/system/semiheap.c    |   2 +-
 tests/tcg/multiarch/system/memory.c    |   2 +-
 6 files changed, 105 insertions(+), 70 deletions(-)

-- 
2.36.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]