[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.0.1 31/44] configure: Fix error message when C compiler is not
From: |
Michael Tokarev |
Subject: |
[Stable-9.0.1 31/44] configure: Fix error message when C compiler is not working |
Date: |
Mon, 27 May 2024 11:21:22 +0300 |
From: Thomas Huth <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>
(cherry picked from commit 371d60dfdb47dd18d163a7759968ba138089371e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/configure b/configure
index b8680df1b0..0aea9b113b 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.39.2
- [Stable-9.0.1 20/44] target/sparc: Fix FMUL8x16, (continued)
- [Stable-9.0.1 20/44] target/sparc: Fix FMUL8x16, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 19/44] target/sparc: Fix FEXPAND, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 35/44] hw/pflash: fix block write start, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 42/44] target/i386: disable jmp_opt if EFLAGS.RF is 1, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 38/44] target/loongarch/kvm: fpu save the vreg registers high 192bit, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 29/44] target/i386: fix feature dependency for WAITPKG, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 32/44] ui/gtk: Fix mouse/motion event scaling issue with GTK display backend, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 34/44] tcg/loongarch64: Fill out tcg_out_{ld, st} for vector regs, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 30/44] configure: quote -D options that are passed through to meson, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 33/44] ui/gtk: Check if fence_fd is equal to or greater than 0, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 31/44] configure: Fix error message when C compiler is not working,
Michael Tokarev <=
- [Stable-9.0.1 39/44] hw/loongarch: Fix fdt memory node wrong 'reg', Michael Tokarev, 2024/05/27
- [Stable-9.0.1 40/44] hw/loongarch/virt: Fix FDT memory node address width, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 41/44] dockerfiles: add 'MAKE' env variable to remaining containers, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 27/44] target/i386: fix operand size for DATA16 REX.W POPCNT, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 44/44] gitlab: Update msys2-64bit runner tags, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 37/44] hw/core/machine: move compatibility flags for VirtIO-net USO to machine 8.1, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 36/44] target-i386: hyper-v: Correct kvm_hv_handle_exit return value, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 43/44] target/i386: no single-step exception after MOV or POP SS, Michael Tokarev, 2024/05/27
- [Stable-9.0.1 23/44] target/sparc: Fix FPMERGE, Michael Tokarev, 2024/05/27