* [PATCH v2] configure: Fix error message when C compiler is not working
@ 2024-05-13 11:40 Thomas Huth
2024-05-13 11:48 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2024-05-13 11:40 UTC (permalink / raw)
To: qemu-devel, Paolo Bonzini, Peter Maydell; +Cc: Alex Bennée
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")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
v2: Reworked the patch according to Peter's suggestions:
https://lists.gnu.org/archive/html/qemu-devel/2024-03/msg04643.html
configure | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 1dca3d94c0..519f1bb6e2 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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] configure: Fix error message when C compiler is not working
2024-05-13 11:40 [PATCH v2] configure: Fix error message when C compiler is not working Thomas Huth
@ 2024-05-13 11:48 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-05-13 11:48 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, Paolo Bonzini, Peter Maydell; +Cc: Alex Bennée
On 13/5/24 13:40, Thomas Huth wrote:
> 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")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> v2: Reworked the patch according to Peter's suggestions:
> https://lists.gnu.org/archive/html/qemu-devel/2024-03/msg04643.html
>
> configure | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-13 11:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-13 11:40 [PATCH v2] configure: Fix error message when C compiler is not working Thomas Huth
2024-05-13 11:48 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.