Patchwork [v2,1/3] configure: Put cross compile flags in EXTRA_CFLAGS

login
register
mail settings
Submitter Peter Crosthwaite
Date Feb. 19, 2013, 4:16 a.m.
Message ID <3ce24095c862b1c00c61fd49a8bcdfb7da1d92f3.1361246789.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/221615/
State New
Headers show

Comments

Peter Crosthwaite - Feb. 19, 2013, 4:16 a.m.
The cross compile CFLAGS are needed to properly build pixman (and any other
submodules). Only the EXTRA_CFLAGS set is passed to submodules not QEMU_CFLAGS,
so put the cross compile flags in EXTRA_CFLAGS instead.

Signed-off-by: Peter Crosthwaite peter.crosthwaite@xilinx.com>
---

 configure |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
Peter Maydell - Feb. 28, 2013, 2:52 p.m.
On 19 February 2013 04:16, Peter Crosthwaite
<peter.crosthwaite@xilinx.com> wrote:
> The cross compile CFLAGS are needed to properly build pixman (and any other
> submodules). Only the EXTRA_CFLAGS set is passed to submodules not QEMU_CFLAGS,
> so put the cross compile flags in EXTRA_CFLAGS instead.
>
> Signed-off-by: Peter Crosthwaite peter.crosthwaite@xilinx.com>
> ---
>
>  configure |   17 +++++++++--------
>  1 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/configure b/configure
> index bf5970f..088909b 100755
> --- a/configure
> +++ b/configure
> @@ -239,8 +239,7 @@ for opt do
>    ;;
>    --cpu=*) cpu="$optarg"
>    ;;
> -  --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
> -                    EXTRA_CFLAGS="$optarg"
> +  --extra-cflags=*) EXTRA_CFLAGS="$optarg"
>    ;;
>    --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
>                       EXTRA_LDFLAGS="$optarg"


>
> +QEMU_CFLAGS="$EXTRA_CFLAGS $QEMU_CFLAGS"
> +
>  default_target_list=""

This change means that flags supplied by the user in --extra-cflags
are not used in compile_prog/compile_object/check_define tests
that happen before this point where we add the EXTRA_CFLAGS
to QEMU_CFLAGS, but then they are used after that. This doesn't
seem like a good thing (it would be reverting a fix inserted
by commit e2a2ed0).

-- PMM
Peter Crosthwaite - March 4, 2013, 4:57 a.m.
On Fri, Mar 1, 2013 at 12:52 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 19 February 2013 04:16, Peter Crosthwaite
> <peter.crosthwaite@xilinx.com> wrote:
>> The cross compile CFLAGS are needed to properly build pixman (and any other
>> submodules). Only the EXTRA_CFLAGS set is passed to submodules not QEMU_CFLAGS,
>> so put the cross compile flags in EXTRA_CFLAGS instead.
>>
>> Signed-off-by: Peter Crosthwaite peter.crosthwaite@xilinx.com>
>> ---
>>
>>  configure |   17 +++++++++--------
>>  1 files changed, 9 insertions(+), 8 deletions(-)
>>
>> diff --git a/configure b/configure
>> index bf5970f..088909b 100755
>> --- a/configure
>> +++ b/configure
>> @@ -239,8 +239,7 @@ for opt do
>>    ;;
>>    --cpu=*) cpu="$optarg"
>>    ;;
>> -  --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
>> -                    EXTRA_CFLAGS="$optarg"
>> +  --extra-cflags=*) EXTRA_CFLAGS="$optarg"
>>    ;;
>>    --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
>>                       EXTRA_LDFLAGS="$optarg"
>
>
>>
>> +QEMU_CFLAGS="$EXTRA_CFLAGS $QEMU_CFLAGS"
>> +
>>  default_target_list=""
>
> This change means that flags supplied by the user in --extra-cflags
> are not used in compile_prog/compile_object/check_define tests
> that happen before this point where we add the EXTRA_CFLAGS
> to QEMU_CFLAGS, but then they are used after that. This doesn't
> seem like a good thing (it would be reverting a fix inserted
> by commit e2a2ed0).
>

Ok. Reverted the first hunk of the patch and changed implementation accordingly.

Regards,
Peter

> -- PMM
>

Patch

diff --git a/configure b/configure
index bf5970f..088909b 100755
--- a/configure
+++ b/configure
@@ -239,8 +239,7 @@  for opt do
   ;;
   --cpu=*) cpu="$optarg"
   ;;
-  --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
-                    EXTRA_CFLAGS="$optarg"
+  --extra-cflags=*) EXTRA_CFLAGS="$optarg"
   ;;
   --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
                      EXTRA_LDFLAGS="$optarg"
@@ -905,33 +904,35 @@  done
 case "$cpu" in
     sparc)
            LDFLAGS="-m32 $LDFLAGS"
-           QEMU_CFLAGS="-m32 -mcpu=ultrasparc $QEMU_CFLAGS"
+           EXTRA_CFLAGS="-m32 -mcpu=ultrasparc $EXTRA_CFLAGS"
            ;;
     sparc64)
            LDFLAGS="-m64 $LDFLAGS"
-           QEMU_CFLAGS="-m64 -mcpu=ultrasparc $QEMU_CFLAGS"
+           EXTRA_CFLAGS="-m64 -mcpu=ultrasparc $EXTRA_CFLAGS"
            ;;
     s390)
-           QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS"
+           EXTRA_CFLAGS="-m31 -march=z990 $EXTRA_CFLAGS"
            LDFLAGS="-m31 $LDFLAGS"
            ;;
     s390x)
-           QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS"
+           EXTRA_CFLAGS="-m64 -march=z990 $EXTRA_CFLAGS"
            LDFLAGS="-m64 $LDFLAGS"
            ;;
     i386)
-           QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
+           EXTRA_CFLAGS="-m32 $EXTRA_CFLAGS"
            LDFLAGS="-m32 $LDFLAGS"
            cc_i386='$(CC) -m32'
            ;;
     x86_64)
-           QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
+           EXTRA_CFLAGS="-m64 $EXTRA_CFLAGS"
            LDFLAGS="-m64 $LDFLAGS"
            cc_i386='$(CC) -m32'
            ;;
     # No special flags required for other host CPUs
 esac
 
+QEMU_CFLAGS="$EXTRA_CFLAGS $QEMU_CFLAGS"
+
 default_target_list=""
 
 # these targets are portable