From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org, matheus.ferst@eldorado.org.br,
alex.bennee@linaro.org
Subject: [PATCH 0/2] build: make tests/tcg compiler detection code more generic
Date: Wed, 22 Jun 2022 15:47:40 +0200 [thread overview]
Message-ID: <20220622134742.139306-1-pbonzini@redhat.com> (raw)
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
next reply other threads:[~2022-06-22 13:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 13:47 Paolo Bonzini [this message]
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
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=20220622134742.139306-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=matheus.ferst@eldorado.org.br \
--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;
as well as URLs for NNTP newsgroup(s).