[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/61] configure: check $CC available before verifyin
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 06/61] configure: check $CC available before verifying host CPU |
Date: |
Mon, 18 Dec 2017 00:27:11 +0300 |
From: Daniel Henrique Barboza <address@hidden>
When executing 'configure' in a fresh QEMU clone, in a fresh
OS install running in a ppc64le host, this is the error
shown:
-----
../configure --enable-trace-backend=simple --enable-debug
--target-list=ppc64-softmmu
ERROR: Unsupported CPU = ppc64le, try --enable-tcg-interpreter
-----
This isn't true, ppc64le host CPU is supported. This happens because,
in a fresh install, we don't have a C compiler to autodetect
the $cpu variable to "ppc64".
This patch moves the CC available check up a bit, just before verifying
the host CPU. This ensures that we bail out with a $CC not available
error instead of unsupported CPU (the host CPU detection without
the compiler wouldn't work properly anyway). It also allows --help to
keep working without a C compiler. With this patch, in the same ppc64le
host without gcc:
$ ../configure --enable-trace-backend=simple --enable-debug
--target-list=ppc64-softmmu
ERROR: "cc" either does not exist or does not work
$ ../configure --help
Usage: configure [options]
Options: [defaults in brackets after descriptions]
Standard options:
--help print this message
--prefix=PREFIX install in PREFIX [/usr/local]
--interp-prefix=PREFIX where to find shared libraries, etc.
(...)
Signed-off-by: Daniel Henrique Barboza <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
configure | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/configure b/configure
index 0c6e7572db..9c8aa5a98b 100755
--- a/configure
+++ b/configure
@@ -1582,6 +1582,20 @@ fi
# Suppress writing compiled files
python="$python -B"
+# Check that the C compiler works. Doing this here before testing
+# the host CPU ensures that we had a valid CC to autodetect the
+# $cpu var (and we should bail right here if that's not the case).
+# It also allows the help message to be printed without a CC.
+write_c_skeleton;
+if compile_object ; then
+ : C compiler works ok
+else
+ error_exit "\"$cc\" either does not exist or does not work"
+fi
+if ! compile_prog ; then
+ error_exit "\"$cc\" cannot build an executable (is your linker broken?)"
+fi
+
# Now we have handled --enable-tcg-interpreter and know we're not just
# printing the help message, bail out if the host CPU isn't supported.
if test "$ARCH" = "unknown"; then
@@ -1603,17 +1617,6 @@ if test -z "$werror" ; then
fi
fi
-# check that the C compiler works.
-write_c_skeleton;
-if compile_object ; then
- : C compiler works ok
-else
- error_exit "\"$cc\" either does not exist or does not work"
-fi
-if ! compile_prog ; then
- error_exit "\"$cc\" cannot build an executable (is your linker broken?)"
-fi
-
if test "$bogus_os" = "yes"; then
# Now that we know that we're not printing the help and that
# the compiler works (so the results of the check_defines we used
--
2.11.0
- [Qemu-devel] [PULL 34/61] i386/hax: remove duplicated includes, (continued)
- [Qemu-devel] [PULL 34/61] i386/hax: remove duplicated includes, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 47/61] hw/tpm: remove old i386 dependency, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 40/61] hw/misc/pvpanic: remove unused #include, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 08/61] .gitignore: remove vscclient, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 04/61] translate-all: fix 'consisits' typo in comment, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 23/61] MAINTAINERS: add an entry for the i82378 (superio), Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 33/61] ppc: remove duplicated includes, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 10/61] Document pretty parameter for mon option, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 41/61] hw/ssi/aspeed_smc: remove unused #include, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 35/61] i386/hax: remove duplicated include, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 06/61] configure: check $CC available before verifying host CPU,
Michael Tokarev <=
- [Qemu-devel] [PULL v2 00/61] Trivial patches for 2017-12-18, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 17/61] hw/registerfields: add 64-bit extract/deposit macros, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 14/61] Makefile: add more targets to the UNCHECKED_GOALS rule, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 49/61] hw/unicore32: restrict hw addr defines to source file, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 48/61] hw/virtio-balloon: remove old i386 dependency, Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 51/61] hw/timer/mc146818: rename rtc_init() -> mc146818_rtc_init(), Michael Tokarev, 2017/12/17
- [Qemu-devel] [PULL 38/61] numa: remove unused #include, Michael Tokarev, 2017/12/17