qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host


From: Daniel Henrique Barboza
Subject: Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
Date: Wed, 1 Nov 2017 17:46:49 -0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0



On 11/01/2017 05:41 PM, Peter Maydell wrote:
On 1 November 2017 at 19:31, Daniel Henrique Barboza
<address@hidden> wrote:
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 <address@hidden>
---
  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
+
I think that currently we try to make "--help" work
even if you don't have a working C compiler. Does this
break that?
Just checked, configure --help isn't broken with this change:


$ ../configure --help

Usage: configure [options]
Options: [defaults in brackets after descriptions]

Standard options:
  --help                   print this message
(...)


Thanks,

Daniel


thanks
-- PMM





reply via email to

[Prev in Thread] Current Thread [Next in Thread]