* [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
@ 2017-11-01 19:31 Daniel Henrique Barboza
2017-11-01 19:36 ` Philippe Mathieu-Daudé
2017-11-01 19:41 ` Peter Maydell
0 siblings, 2 replies; 7+ messages in thread
From: Daniel Henrique Barboza @ 2017-11-01 19:31 UTC (permalink / raw)
To: qemu-devel; +Cc: mdroth, peter.maydell
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
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
2017-11-01 19:31 [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU Daniel Henrique Barboza
@ 2017-11-01 19:36 ` Philippe Mathieu-Daudé
2017-11-01 19:41 ` Daniel Henrique Barboza
2017-11-01 19:41 ` Peter Maydell
1 sibling, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-11-01 19:36 UTC (permalink / raw)
To: Daniel Henrique Barboza, qemu-devel; +Cc: peter.maydell, mdroth
Maybe "configure: check $CC available before verifying host CPU" ?
On 11/01/2017 04:31 PM, Daniel Henrique Barboza 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 <danielhb@linux.vnet.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> 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
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
2017-11-01 19:36 ` Philippe Mathieu-Daudé
@ 2017-11-01 19:41 ` Daniel Henrique Barboza
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Henrique Barboza @ 2017-11-01 19:41 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel; +Cc: peter.maydell, mdroth
On 11/01/2017 05:36 PM, Philippe Mathieu-Daudé wrote:
> Maybe "configure: check $CC available before verifying host CPU" ?
If the maintainer is willing to amend the patch before pushing, works
for me!
Daniel
>
> On 11/01/2017 04:31 PM, Daniel Henrique Barboza 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 <danielhb@linux.vnet.ibm.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
>> ---
>> 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
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
2017-11-01 19:31 [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU Daniel Henrique Barboza
2017-11-01 19:36 ` Philippe Mathieu-Daudé
@ 2017-11-01 19:41 ` Peter Maydell
2017-11-01 19:46 ` Daniel Henrique Barboza
1 sibling, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2017-11-01 19:41 UTC (permalink / raw)
To: Daniel Henrique Barboza; +Cc: QEMU Developers, Michael Roth
On 1 November 2017 at 19:31, Daniel Henrique Barboza
<danielhb@linux.vnet.ibm.com> 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 <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
> +
I think that currently we try to make "--help" work
even if you don't have a working C compiler. Does this
break that?
thanks
-- PMM
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
2017-11-01 19:41 ` Peter Maydell
@ 2017-11-01 19:46 ` Daniel Henrique Barboza
2017-11-01 23:41 ` Peter Maydell
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Henrique Barboza @ 2017-11-01 19:46 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Developers, Michael Roth
On 11/01/2017 05:41 PM, Peter Maydell wrote:
> On 1 November 2017 at 19:31, Daniel Henrique Barboza
> <danielhb@linux.vnet.ibm.com> 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 <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
>> +
> 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
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
2017-11-01 19:46 ` Daniel Henrique Barboza
@ 2017-11-01 23:41 ` Peter Maydell
2017-11-02 1:22 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2017-11-01 23:41 UTC (permalink / raw)
To: Daniel Henrique Barboza; +Cc: QEMU Developers, Michael Roth
On 1 November 2017 at 19:46, Daniel Henrique Barboza
<danielhb@linux.vnet.ibm.com> wrote:
> On 11/01/2017 05:41 PM, Peter Maydell wrote:
>> 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:
Did you test with gcc uninstalled again? It's hard to see
how it could work -- if the compile test fails we'll call
error_exit, which (as the name suggests) exits. Your patch
moves the compiler check from after we handle --help to
before it...
thanks
-- PMM
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU
2017-11-01 23:41 ` Peter Maydell
@ 2017-11-02 1:22 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-11-02 1:22 UTC (permalink / raw)
To: Peter Maydell, Daniel Henrique Barboza; +Cc: QEMU Developers, Michael Roth
>>> 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:
>
> Did you test with gcc uninstalled again? It's hard to see
> how it could work -- if the compile test fails we'll call
> error_exit, which (as the name suggests) exits. Your patch
> moves the compiler check from after we handle --help to
> before it...
$ CC=asdf ./configure --help
ERROR: "asdf" either does not exist or does not work
Oops.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-11-02 1:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-01 19:31 [Qemu-devel] [PATCH v4] configure: do CC check before verifying host CPU Daniel Henrique Barboza
2017-11-01 19:36 ` 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é
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.