From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
Date: Wed, 1 Nov 2017 17:31:26 -0200 [thread overview]
Message-ID: <20171101193126.19730-1-danielhb@linux.vnet.ibm.com> (raw)
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".
Since we need a C compiler to properly get the value of $cpu
in this and other cases, this patch changes the location of the C
compiler check right after setting the preferred CC.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
---
configure | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/configure b/configure
index 285d123dbf..a641bf18b6 100755
--- a/configure
+++ b/configure
@@ -467,6 +467,23 @@ else
cc="${CC-${cross_prefix}gcc}"
fi
+write_c_skeleton() {
+ cat > $TMPC <<EOF
+int main(void) { return 0; }
+EOF
+}
+
+# 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 -z "${CXX}${cross_prefix}"; then
cxx="c++"
else
@@ -537,12 +554,6 @@ EOF
compile_object
}
-write_c_skeleton() {
- cat > $TMPC <<EOF
-int main(void) { return 0; }
-EOF
-}
-
if check_define __linux__ ; then
targetos="Linux"
elif check_define _WIN32 ; then
@@ -1593,17 +1604,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.13.6
next reply other threads:[~2017-11-01 19:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-01 19:31 Daniel Henrique Barboza [this message]
2017-11-01 19:36 ` [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU Philippe Mathieu-Daudé
2017-11-01 19:41 ` Daniel Henrique Barboza
2017-11-01 19:41 ` Peter Maydell
2017-11-01 19:46 ` Daniel Henrique Barboza
2017-11-01 23:41 ` Peter Maydell
2017-11-02 1:22 ` Philippe Mathieu-Daudé
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=20171101193126.19730-1-danielhb@linux.vnet.ibm.com \
--to=danielhb@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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 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.