[Qemu-devel] [PATCH 2/2] configure: Use quotes around uses of $CPU_CFLAGS

Richard Henderson posted 2 patches 6 years, 6 months ago
[Qemu-devel] [PATCH 2/2] configure: Use quotes around uses of $CPU_CFLAGS
Posted by Richard Henderson 6 years, 6 months ago
About half of the values to which CPU_CFLAGS is set
have multiple space separated arguments.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 configure | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 234cb929ca..16bd4375d1 100755
--- a/configure
+++ b/configure
@@ -1543,37 +1543,37 @@ case "$cpu" in
            CPU_CFLAGS="-m64"
            LDFLAGS="-m64 $LDFLAGS"
            cross_cc_ppc64=$cc
-           cross_cc_cflags_ppc64=$CPU_CFLAGS
+           cross_cc_cflags_ppc64="$CPU_CFLAGS"
            ;;
     sparc)
            CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc"
            LDFLAGS="-m32 -mv8plus $LDFLAGS"
            cross_cc_sparc=$cc
-           cross_cc_cflags_sparc=$CPU_CFLAGS
+           cross_cc_cflags_sparc="$CPU_CFLAGS"
            ;;
     sparc64)
            CPU_CFLAGS="-m64 -mcpu=ultrasparc"
            LDFLAGS="-m64 $LDFLAGS"
            cross_cc_sparc64=$cc
-           cross_cc_cflags_sparc64=$CPU_CFLAGS
+           cross_cc_cflags_sparc64="$CPU_CFLAGS"
            ;;
     s390)
            CPU_CFLAGS="-m31"
            LDFLAGS="-m31 $LDFLAGS"
            cross_cc_s390=$cc
-           cross_cc_cflags_s390=$CPU_CFLAGS
+           cross_cc_cflags_s390="$CPU_CFLAGS"
            ;;
     s390x)
            CPU_CFLAGS="-m64"
            LDFLAGS="-m64 $LDFLAGS"
            cross_cc_s390x=$cc
-           cross_cc_cflags_s390x=$CPU_CFLAGS
+           cross_cc_cflags_s390x="$CPU_CFLAGS"
            ;;
     i386)
            CPU_CFLAGS="-m32"
            LDFLAGS="-m32 $LDFLAGS"
            cross_cc_i386=$cc
-           cross_cc_cflags_i386=$CPU_CFLAGS
+           cross_cc_cflags_i386="$CPU_CFLAGS"
            ;;
     x86_64)
            # ??? Only extremely old AMD cpus do not have cmpxchg16b.
@@ -1582,13 +1582,13 @@ case "$cpu" in
            CPU_CFLAGS="-m64 -mcx16"
            LDFLAGS="-m64 $LDFLAGS"
            cross_cc_x86_64=$cc
-           cross_cc_cflags_x86_64=$CPU_CFLAGS
+           cross_cc_cflags_x86_64="$CPU_CFLAGS"
            ;;
     x32)
            CPU_CFLAGS="-mx32"
            LDFLAGS="-mx32 $LDFLAGS"
            cross_cc_i386=$cc
-           cross_cc_cflags_i386=$CPU_CFLAGS
+           cross_cc_cflags_i386="$CPU_CFLAGS"
            ;;
     # No special flags required for other host CPUs
 esac
-- 
2.17.1


Re: [Qemu-devel] [PATCH 2/2] configure: Use quotes around uses of $CPU_CFLAGS
Posted by Eric Blake 6 years, 6 months ago
On 5/1/19 5:38 PM, Richard Henderson wrote:
> About half of the values to which CPU_CFLAGS is set
> have multiple space separated arguments.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  configure | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/configure b/configure
> index 234cb929ca..16bd4375d1 100755
> --- a/configure
> +++ b/configure
> @@ -1543,37 +1543,37 @@ case "$cpu" in
>             CPU_CFLAGS="-m64"
>             LDFLAGS="-m64 $LDFLAGS"
>             cross_cc_ppc64=$cc
> -           cross_cc_cflags_ppc64=$CPU_CFLAGS
> +           cross_cc_cflags_ppc64="$CPU_CFLAGS"

Makes no difference semantically (bare variable assignments are not
subject to word splitting or globbing, so the quotes don't change the
result); the only reason to change this is for consistency (using quotes
everywhere is easier to remember, whether or not they are in a context
that matter).

So I'm okay whether this patch goes in or is omitted.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH 2/2] configure: Use quotes around uses of $CPU_CFLAGS
Posted by Philippe Mathieu-Daudé 6 years, 6 months ago
On 5/2/19 12:38 AM, Richard Henderson wrote:
> About half of the values to which CPU_CFLAGS is set
> have multiple space separated arguments.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  configure | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/configure b/configure
> index 234cb929ca..16bd4375d1 100755
> --- a/configure
> +++ b/configure
> @@ -1543,37 +1543,37 @@ case "$cpu" in
>             CPU_CFLAGS="-m64"
>             LDFLAGS="-m64 $LDFLAGS"
>             cross_cc_ppc64=$cc
> -           cross_cc_cflags_ppc64=$CPU_CFLAGS
> +           cross_cc_cflags_ppc64="$CPU_CFLAGS"
>             ;;
>      sparc)
>             CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc"
>             LDFLAGS="-m32 -mv8plus $LDFLAGS"
>             cross_cc_sparc=$cc
> -           cross_cc_cflags_sparc=$CPU_CFLAGS
> +           cross_cc_cflags_sparc="$CPU_CFLAGS"
>             ;;
>      sparc64)
>             CPU_CFLAGS="-m64 -mcpu=ultrasparc"
>             LDFLAGS="-m64 $LDFLAGS"
>             cross_cc_sparc64=$cc
> -           cross_cc_cflags_sparc64=$CPU_CFLAGS
> +           cross_cc_cflags_sparc64="$CPU_CFLAGS"
>             ;;
>      s390)
>             CPU_CFLAGS="-m31"
>             LDFLAGS="-m31 $LDFLAGS"
>             cross_cc_s390=$cc
> -           cross_cc_cflags_s390=$CPU_CFLAGS
> +           cross_cc_cflags_s390="$CPU_CFLAGS"
>             ;;
>      s390x)
>             CPU_CFLAGS="-m64"
>             LDFLAGS="-m64 $LDFLAGS"
>             cross_cc_s390x=$cc
> -           cross_cc_cflags_s390x=$CPU_CFLAGS
> +           cross_cc_cflags_s390x="$CPU_CFLAGS"
>             ;;
>      i386)
>             CPU_CFLAGS="-m32"
>             LDFLAGS="-m32 $LDFLAGS"
>             cross_cc_i386=$cc
> -           cross_cc_cflags_i386=$CPU_CFLAGS
> +           cross_cc_cflags_i386="$CPU_CFLAGS"
>             ;;
>      x86_64)
>             # ??? Only extremely old AMD cpus do not have cmpxchg16b.
> @@ -1582,13 +1582,13 @@ case "$cpu" in
>             CPU_CFLAGS="-m64 -mcx16"
>             LDFLAGS="-m64 $LDFLAGS"
>             cross_cc_x86_64=$cc
> -           cross_cc_cflags_x86_64=$CPU_CFLAGS
> +           cross_cc_cflags_x86_64="$CPU_CFLAGS"
>             ;;
>      x32)
>             CPU_CFLAGS="-mx32"
>             LDFLAGS="-mx32 $LDFLAGS"
>             cross_cc_i386=$cc
> -           cross_cc_cflags_i386=$CPU_CFLAGS
> +           cross_cc_cflags_i386="$CPU_CFLAGS"
>             ;;
>      # No special flags required for other host CPUs
>  esac
>