From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Subject: [PULL 01/11] configure: Fix error message when C compiler is not working
Date: Tue, 14 May 2024 14:51:09 +0200 [thread overview]
Message-ID: <20240514125119.284638-2-thuth@redhat.com> (raw)
In-Reply-To: <20240514125119.284638-1-thuth@redhat.com>
If you try to run the configure script on a system without a working
C compiler, you get a very misleading error message:
ERROR: Unrecognized host OS (uname -s reports 'Linux')
Some people already opened bug tickets because of this problem:
https://gitlab.com/qemu-project/qemu/-/issues/2057
https://gitlab.com/qemu-project/qemu/-/issues/2288
We should rather tell the user that we were not able to use the C
compiler instead, otherwise they will have a hard time to figure
out what was going wrong.
While we're at it, let's also suppress the "unrecognized host CPU"
message in this case since it is rather misleading than helpful.
Fixes: 264b803721 ("configure: remove compiler sanity check")
Message-ID: <20240513114010.51608-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
configure | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 330664786d..38ee257701 100755
--- a/configure
+++ b/configure
@@ -411,7 +411,9 @@ else
# Using uname is really broken, but it is just a fallback for architectures
# that are going to use TCI anyway
cpu=$(uname -m)
- echo "WARNING: unrecognized host CPU, proceeding with 'uname -m' output '$cpu'"
+ if test "$host_os" != "bogus"; then
+ echo "WARNING: unrecognized host CPU, proceeding with 'uname -m' output '$cpu'"
+ fi
fi
# Normalise host CPU name to the values used by Meson cross files and in source
@@ -894,6 +896,13 @@ EOF
exit 0
fi
+# Now that we are sure that the user did not only want to print the --help
+# information, we should double-check that the C compiler really works:
+write_c_skeleton
+if ! compile_object ; then
+ error_exit "C compiler \"$cc\" either does not exist or does not work."
+fi
+
# Remove old dependency files to make sure that they get properly regenerated
rm -f ./*/config-devices.mak.d
--
2.45.0
next prev parent reply other threads:[~2024-05-14 12:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 12:51 [PULL 00/11] gitlab CI fix and glib update Thomas Huth
2024-05-14 12:51 ` Thomas Huth [this message]
2024-05-14 12:51 ` [PULL 02/11] dockerfiles: add 'MAKE' env variable to remaining containers Thomas Huth
2024-05-14 12:51 ` [PULL 03/11] gitlab: use $MAKE instead of 'make' Thomas Huth
2024-05-14 12:51 ` [PULL 04/11] gitlab: use 'setarch -R' to workaround tsan bug Thomas Huth
2024-05-14 12:51 ` [PULL 05/11] Bump minimum glib version to v2.66 Thomas Huth
2024-05-14 12:51 ` [PULL 06/11] Remove glib compatibility code that is not required anymore Thomas Huth
2024-05-14 12:51 ` [PULL 07/11] block/gluster: Use URI parsing code from glib Thomas Huth
2024-05-14 12:51 ` [PULL 08/11] block/nbd: " Thomas Huth
2024-05-14 12:51 ` [PULL 09/11] block/nfs: " Thomas Huth
2024-05-14 12:51 ` [PULL 10/11] block/ssh: " Thomas Huth
2024-05-14 12:51 ` [PULL 11/11] util/uri: Remove the old URI parsing code Thomas Huth
2024-05-15 6:51 ` [PULL 00/11] gitlab CI fix and glib update Richard Henderson
2024-05-15 10:39 ` Daniel P. Berrangé
2024-05-27 19:09 ` Michael Tokarev
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=20240514125119.284638-2-thuth@redhat.com \
--to=thuth@redhat.com \
--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).