]> git.proxmox.com Git - mirror_qemu.git/commit - configure
build: try both native and cross compilers
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Jun 2022 08:42:58 +0000 (10:42 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Jul 2022 09:03:01 +0000 (11:03 +0200)
commit92e288fcfbf2908450023e85c0d53c1ebb8dbd30
treecdd6a0e12b2cc36bdde5b930a202e2b05dd4c90c
parent52f08deaf803fa95fd12a886f854502ca632d562
build: try both native and cross compilers

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 and, while at it, restrict the softmmu emulation
target to basically a test for the presence of libgcc.

Tested-by: Matheus Kowalczuk Ferst <matheus.ferst@eldorado.org.br>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure