* [PATCH] configure: fix parameter expansion of --cross-cc-cflags options
@ 2022-01-20 17:31 matheus.ferst
2022-01-22 9:47 ` Philippe Mathieu-Daudé via
2022-01-24 14:21 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: matheus.ferst @ 2022-01-20 17:31 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, thuth, richard.henderson, Matheus Ferst
From: Matheus Ferst <matheus.ferst@eldorado.org.br>
Without this fix, any use of --cross-cc-cflags-* causes a message like:
$ ../configure --cross-cc-ppc64le=clang --cross-cc-cflags-ppc64le="-target powerpc64le-unknown-linux-gnu -sysroot ..."
../configure: 1: eval: cross_cc_cflags_--cross-cc-cflags-ppc64le=-target: not found
../configure: 3816: export: cross_cc_cflags_--cross-cc-cflags-ppc64le: bad variable name
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index e1a31fb332..4735c1bffc 100755
--- a/configure
+++ b/configure
@@ -402,7 +402,7 @@ for opt do
;;
--cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
;;
- --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*}
+ --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-cflags-}; cc_arch=${cc_arch%%=*}
eval "cross_cc_cflags_${cc_arch}=\$optarg"
cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}"
;;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] configure: fix parameter expansion of --cross-cc-cflags options
2022-01-20 17:31 [PATCH] configure: fix parameter expansion of --cross-cc-cflags options matheus.ferst
@ 2022-01-22 9:47 ` Philippe Mathieu-Daudé via
2022-01-24 14:21 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-01-22 9:47 UTC (permalink / raw)
To: matheus.ferst, qemu-devel
Cc: pbonzini, thuth, richard.henderson, Alex Bennée
On 20/1/22 18:31, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
>
> Without this fix, any use of --cross-cc-cflags-* causes a message like:
> $ ../configure --cross-cc-ppc64le=clang --cross-cc-cflags-ppc64le="-target powerpc64le-unknown-linux-gnu -sysroot ..."
> ../configure: 1: eval: cross_cc_cflags_--cross-cc-cflags-ppc64le=-target: not found
> ../configure: 3816: export: cross_cc_cflags_--cross-cc-cflags-ppc64le: bad variable name
>
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
> ---
> configure | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index e1a31fb332..4735c1bffc 100755
> --- a/configure
> +++ b/configure
> @@ -402,7 +402,7 @@ for opt do
> ;;
> --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
> ;;
> - --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*}
> + --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-cflags-}; cc_arch=${cc_arch%%=*}
> eval "cross_cc_cflags_${cc_arch}=\$optarg"
> cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}"
> ;;
Commit d422b2bc23 subject is "configure: allow user to specify
--cross-cc-cflags-foo=" but then documented "--cross-cc-flags":
$ git grep cc-flag
configure:409: --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-};
cc_arch=${cc_arch%%=*}
configure:1338: --cross-cc-flags-ARCH= use compiler flags when
building ARCH guest tests
docs/devel/testing.rst:1327:There is also a ``--cross-cc-flags-ARCH``
flag in case additional
$ git grep cross.*flag
configure:409: --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-};
cc_arch=${cc_arch%%=*}
configure:410: eval
"cross_cc_cflags_${cc_arch}=\$optarg"
configure:411: cross_cc_vars="$cross_cc_vars
cross_cc_cflags_${cc_arch}"
configure:1338: --cross-cc-flags-ARCH= use compiler flags when
building ARCH guest tests
docs/devel/testing.rst:1327:There is also a ``--cross-cc-flags-ARCH``
flag in case additional
tests/tcg/configure.sh:48:: ${cross_cc_cflags_aarch64_be="-mbig-endian"}
tests/tcg/configure.sh:51:: ${cross_cc_cflags_armeb="-mbig-endian"}
tests/tcg/configure.sh:53:: ${cross_cc_cflags_hexagon="-mv67 -O2 -static"}
tests/tcg/configure.sh:56:: ${cross_cc_cflags_i386="-m32"}
tests/tcg/configure.sh:65:: ${cross_cc_cflags_ppc="-m32"}
tests/tcg/configure.sh:67:: ${cross_cc_cflags_ppc64="-m64 -mbig"}
tests/tcg/configure.sh:69:: ${cross_cc_cflags_ppc64le="-m64 -mlittle"}
tests/tcg/configure.sh:73:: ${cross_cc_cflags_sparc="-m32 -mv8plus
-mcpu=ultrasparc"}
tests/tcg/configure.sh:75:: ${cross_cc_cflags_sparc64="-m64
-mcpu=ultrasparc"}
tests/tcg/configure.sh:77:: ${cross_cc_cflags_x86_64="-m64"}
tests/tcg/configure.sh:244: eval
"target_compiler_cflags=\${cross_cc_cflags_$arch}"
OK, 'cflags' wins over 'flags'.
I agree this requires cleanup, but all occurrences need to be updated.
Please Cc Alex in v2, and add:
Fixes: d422b2bc23 ("configure: allow user to specify
--cross-cc-cflags-foo=")
Thanks,
Phil.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] configure: fix parameter expansion of --cross-cc-cflags options
2022-01-20 17:31 [PATCH] configure: fix parameter expansion of --cross-cc-cflags options matheus.ferst
2022-01-22 9:47 ` Philippe Mathieu-Daudé via
@ 2022-01-24 14:21 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-01-24 14:21 UTC (permalink / raw)
To: matheus.ferst, qemu-devel; +Cc: thuth, richard.henderson
On 1/20/22 18:31, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
>
> Without this fix, any use of --cross-cc-cflags-* causes a message like:
> $ ../configure --cross-cc-ppc64le=clang --cross-cc-cflags-ppc64le="-target powerpc64le-unknown-linux-gnu -sysroot ..."
> ../configure: 1: eval: cross_cc_cflags_--cross-cc-cflags-ppc64le=-target: not found
> ../configure: 3816: export: cross_cc_cflags_--cross-cc-cflags-ppc64le: bad variable name
>
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
> ---
> configure | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index e1a31fb332..4735c1bffc 100755
> --- a/configure
> +++ b/configure
> @@ -402,7 +402,7 @@ for opt do
> ;;
> --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
> ;;
> - --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*}
> + --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-cflags-}; cc_arch=${cc_arch%%=*}
> eval "cross_cc_cflags_${cc_arch}=\$optarg"
> cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}"
> ;;
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-24 14:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 17:31 [PATCH] configure: fix parameter expansion of --cross-cc-cflags options matheus.ferst
2022-01-22 9:47 ` Philippe Mathieu-Daudé via
2022-01-24 14:21 ` Paolo Bonzini
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.