qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé via" <qemu-devel@nongnu.org>
To: matheus.ferst@eldorado.org.br, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, thuth@redhat.com,
	richard.henderson@linaro.org,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH] configure: fix parameter expansion of --cross-cc-cflags options
Date: Sat, 22 Jan 2022 10:47:13 +0100	[thread overview]
Message-ID: <a79c92dc-dc6c-0c26-f3f8-c10d8d32b787@amsat.org> (raw)
In-Reply-To: <20220120173142.2755077-1-matheus.ferst@eldorado.org.br>

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.


  reply	other threads:[~2022-01-22  9:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-01-24 14:21 ` Paolo Bonzini

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=a79c92dc-dc6c-0c26-f3f8-c10d8d32b787@amsat.org \
    --to=qemu-devel@nongnu.org \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=pbonzini@redhat.com \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).