qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 1/4] configure: move EXTRA_CFLAGS append to


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC PATCH 1/4] configure: move EXTRA_CFLAGS append to the end
Date: Mon, 25 Jan 2016 17:04:29 +0000

On 25 January 2016 at 16:49, Alex Bennée <address@hidden> wrote:
> When using --extra-cflags to override defaults the flags need to be set
> at the end lest they be reset by later options. This affects
> optimisation as well where "-O0 .. -O3" will just takes the most recent
> option.
>
> We also set CFLAGS so the options are passed to other built binaries.
>
> Signed-off-by: Alex Bennée <address@hidden>
> ---
>  configure | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 44ac9ab..7d23c6c 100755
> --- a/configure
> +++ b/configure
> @@ -360,8 +360,7 @@ for opt do
>    ;;
>    --cpu=*) cpu="$optarg"
>    ;;
> -  --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg"
> -                    EXTRA_CFLAGS="$optarg"
> +  --extra-cflags=*) EXTRA_CFLAGS="$optarg"
>    ;;
>    --extra-ldflags=*) LDFLAGS="$LDFLAGS $optarg"
>                       EXTRA_LDFLAGS="$optarg"
> @@ -4715,6 +4714,10 @@ fi
>  QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS"
>  libs_softmmu="$pixman_libs $libs_softmmu"
>
> +# Now it the time to append extra-cflags
> +CFLAGS="$CFLAGS $EXTRA_CFLAGS"

We don't in general use plain CFLAGS. What breaks without this?
(For instance, when we build pixman we set its CFLAGS to include
extra_cflags in the makefile rune.)

> +QEMU_CFLAGS="$QEMU_CFLAGS $EXTRA_CFLAGS"
> +
>  echo "Install prefix    $prefix"
>  echo "BIOS directory    `eval echo $qemu_datadir`"
>  echo "binary directory  `eval echo $bindir`"

I think this will break the use case where you were using --extra-cflags
to pass flags that are needed for the test code in configure to build
correctly.

thanks
-- PMM



reply via email to

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