qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] build: make tests/tcg compiler detection code more generic
@ 2022-06-22 13:47 Paolo Bonzini
  2022-06-22 13:47 ` [PATCH 1/2] tests/tcg: compile system emulation tests as freestanding Paolo Bonzini
  2022-06-22 13:47 ` [PATCH 2/2] build: try both native and cross compilers for linux-user tests Paolo Bonzini
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2022-06-22 13:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, matheus.ferst, alex.bennee

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-22 17:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-22 13:47 [PATCH 0/2] build: make tests/tcg compiler detection code more generic Paolo Bonzini
2022-06-22 13:47 ` [PATCH 1/2] tests/tcg: compile system emulation tests as freestanding Paolo Bonzini
2022-06-22 14:52   ` Richard Henderson
2022-06-22 13:47 ` [PATCH 2/2] build: try both native and cross compilers for linux-user tests Paolo Bonzini
2022-06-22 17:30   ` Matheus Kowalczuk Ferst

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).