diff mbox series

[v1,03/24] configure: move i386_cc to cross_cc_i386

Message ID 20180410193919.28026-4-alex.bennee@linaro.org
State Superseded
Headers show
Series fix building of tests/tcg | expand

Commit Message

Alex Bennée April 10, 2018, 7:38 p.m. UTC
We should still be able to use the system cross compiler with the
appropriate flags on x86_64 hosts.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 configure | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

-- 
2.16.2

Comments

Philippe Mathieu-Daudé April 16, 2018, 12:01 a.m. UTC | #1
Hi Alex,

On 04/10/2018 04:38 PM, Alex Bennée wrote:
> We should still be able to use the system cross compiler with the

> appropriate flags on x86_64 hosts.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  configure | 23 +++++++++++++++--------

>  1 file changed, 15 insertions(+), 8 deletions(-)

> 

> diff --git a/configure b/configure

> index b5f3b3fe29..add87ff4d4 100755

> --- a/configure

> +++ b/configure

> @@ -284,7 +284,6 @@ libs_softmmu=""

>  libs_tools=""

>  audio_pt_int=""

>  audio_win_int=""

> -cc_i386=i386-pc-linux-gnu-gcc

>  libs_qga=""

>  debug_info="yes"

>  stack_protector=""

> @@ -457,6 +456,8 @@ docker="no"

>  cross_cc_aarch64="aarch64-linux-gnu-gcc"

>  cross_cc_arm="arm-linux-gnueabihf-gcc"

>  cross_cc_powerpc="powerpc-linux-gnu-gcc"

> +cross_cc_i386="i386-pc-linux-gnu-gcc"

> +cross_cc_i386_cflags=""


Can you keep this sorted? (arm < i386 < powerpc)

Thanks :)

>  

>  enabled_cross_compilers=""

>  

> @@ -687,12 +688,10 @@ case "$cpu" in


What do you think about renaming $cpu -> host_cpu/target_cpu?

>    i386|i486|i586|i686|i86pc|BePC)

>      cpu="i386"

>      supported_cpu="yes"

> -    cross_cc_i386=gcc

>    ;;

>    x86_64|amd64)

>      cpu="x86_64"

>      supported_cpu="yes"

> -    cross_cc_x86_64=gcc

>    ;;

>    armv*b|armv*l|arm)

>      cpu="arm"

> @@ -1435,7 +1434,6 @@ case "$cpu" in

>      i386)

>             CPU_CFLAGS="-m32"

>             LDFLAGS="-m32 $LDFLAGS"

> -           cc_i386='$(CC) -m32'

>             ;;

>      x86_64)

>             # ??? Only extremely old AMD cpus do not have cmpxchg16b.

> @@ -1443,12 +1441,14 @@ case "$cpu" in

>             # runtime and generate the fallback to serial emulation.

>             CPU_CFLAGS="-m64 -mcx16"

>             LDFLAGS="-m64 $LDFLAGS"

> -           cc_i386='$(CC) -m32'

> +           cross_cc_i386=$cc

> +           cross_cc_i386_cflags="-m32"

>             ;;

>      x32)

>             CPU_CFLAGS="-mx32"

>             LDFLAGS="-mx32 $LDFLAGS"

> -           cc_i386='$(CC) -m32'

> +           cross_cc_i386=$cc

> +           cross_cc_i386_cflags="-m32"

>             ;;

>      # No special flags required for other host CPUs

>  esac

> @@ -6664,7 +6664,6 @@ echo "CC=$cc" >> $config_host_mak

>  if $iasl -h > /dev/null 2>&1; then

>    echo "IASL=$iasl" >> $config_host_mak

>  fi

> -echo "CC_I386=$cc_i386" >> $config_host_mak

>  echo "HOST_CC=$host_cc" >> $config_host_mak

>  echo "CXX=$cxx" >> $config_host_mak

>  echo "OBJCC=$objcc" >> $config_host_mak

> @@ -6783,6 +6782,7 @@ case "$target" in

>  esac

>  

>  target_compiler=""

> +target_compiler_cflags=""

>  

>  mkdir -p $target_dir

>  echo "# Automatically generated by configure - do not modify" > $config_target_mak

> @@ -6799,10 +6799,13 @@ TARGET_ABI_DIR=""

>  case "$target_name" in

>    i386)

>      gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml"

> +    target_compiler=$cross_cc_i386

> +    target_compiler_cflags=$cross_cc_i386_cflags

>    ;;

>    x86_64)

>      TARGET_BASE_ARCH=i386

>      gdb_xml_files="i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml"

> +    target_compiler=$cross_cc_x86_64

>    ;;

>    alpha)

>      mttcg="yes"

> @@ -6947,7 +6950,7 @@ int main(void) {

>  }

>  EOF

>  

> -    if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then

> +    if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE $TMPC -static ; then

>          target_compiler=""

>      else

>          enabled_cross_compilers="${enabled_cross_compilers} ${target_compiler}"

> @@ -7033,6 +7036,10 @@ if test -n "$target_compiler"; then

>    echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak

>  fi

>  

> +if test -n "$target_compiler_cflags"; then

> +  echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak

> +fi

> +

>  # generate QEMU_CFLAGS/LDFLAGS for targets

>  

>  cflags=""

>
Alex Bennée April 16, 2018, 9:02 a.m. UTC | #2
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Hi Alex,

>

> On 04/10/2018 04:38 PM, Alex Bennée wrote:

>> We should still be able to use the system cross compiler with the

>> appropriate flags on x86_64 hosts.

>> 

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> ---

>>  configure | 23 +++++++++++++++--------

>>  1 file changed, 15 insertions(+), 8 deletions(-)

>> 

>> diff --git a/configure b/configure

>> index b5f3b3fe29..add87ff4d4 100755

>> --- a/configure

>> +++ b/configure

>> @@ -284,7 +284,6 @@ libs_softmmu=""

>>  libs_tools=""

>>  audio_pt_int=""

>>  audio_win_int=""

>> -cc_i386=i386-pc-linux-gnu-gcc

>>  libs_qga=""

>>  debug_info="yes"

>>  stack_protector=""

>> @@ -457,6 +456,8 @@ docker="no"

>>  cross_cc_aarch64="aarch64-linux-gnu-gcc"

>>  cross_cc_arm="arm-linux-gnueabihf-gcc"

>>  cross_cc_powerpc="powerpc-linux-gnu-gcc"

>> +cross_cc_i386="i386-pc-linux-gnu-gcc"

>> +cross_cc_i386_cflags=""

>

> Can you keep this sorted? (arm < i386 < powerpc)


Sure.

>

> Thanks :)

>

>>  

>>  enabled_cross_compilers=""

>>  

>> @@ -687,12 +688,10 @@ case "$cpu" in

>

> What do you think about renaming $cpu -> host_cpu/target_cpu?


I'd rather avoid too much churn in configure. Maybe a separate clean-up
patch?

>

>>    i386|i486|i586|i686|i86pc|BePC)

>>      cpu="i386"

>>      supported_cpu="yes"

>> -    cross_cc_i386=gcc

>>    ;;

>>    x86_64|amd64)

>>      cpu="x86_64"

>>      supported_cpu="yes"

>> -    cross_cc_x86_64=gcc

>>    ;;

>>    armv*b|armv*l|arm)

>>      cpu="arm"

>> @@ -1435,7 +1434,6 @@ case "$cpu" in

>>      i386)

>>             CPU_CFLAGS="-m32"

>>             LDFLAGS="-m32 $LDFLAGS"

>> -           cc_i386='$(CC) -m32'

>>             ;;

>>      x86_64)

>>             # ??? Only extremely old AMD cpus do not have cmpxchg16b.

>> @@ -1443,12 +1441,14 @@ case "$cpu" in

>>             # runtime and generate the fallback to serial emulation.

>>             CPU_CFLAGS="-m64 -mcx16"

>>             LDFLAGS="-m64 $LDFLAGS"

>> -           cc_i386='$(CC) -m32'

>> +           cross_cc_i386=$cc

>> +           cross_cc_i386_cflags="-m32"

>>             ;;

>>      x32)

>>             CPU_CFLAGS="-mx32"

>>             LDFLAGS="-mx32 $LDFLAGS"

>> -           cc_i386='$(CC) -m32'

>> +           cross_cc_i386=$cc

>> +           cross_cc_i386_cflags="-m32"

>>             ;;

>>      # No special flags required for other host CPUs

>>  esac

>> @@ -6664,7 +6664,6 @@ echo "CC=$cc" >> $config_host_mak

>>  if $iasl -h > /dev/null 2>&1; then

>>    echo "IASL=$iasl" >> $config_host_mak

>>  fi

>> -echo "CC_I386=$cc_i386" >> $config_host_mak

>>  echo "HOST_CC=$host_cc" >> $config_host_mak

>>  echo "CXX=$cxx" >> $config_host_mak

>>  echo "OBJCC=$objcc" >> $config_host_mak

>> @@ -6783,6 +6782,7 @@ case "$target" in

>>  esac

>>  

>>  target_compiler=""

>> +target_compiler_cflags=""

>>  

>>  mkdir -p $target_dir

>>  echo "# Automatically generated by configure - do not modify" > $config_target_mak

>> @@ -6799,10 +6799,13 @@ TARGET_ABI_DIR=""

>>  case "$target_name" in

>>    i386)

>>      gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml"

>> +    target_compiler=$cross_cc_i386

>> +    target_compiler_cflags=$cross_cc_i386_cflags

>>    ;;

>>    x86_64)

>>      TARGET_BASE_ARCH=i386

>>      gdb_xml_files="i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml"

>> +    target_compiler=$cross_cc_x86_64

>>    ;;

>>    alpha)

>>      mttcg="yes"

>> @@ -6947,7 +6950,7 @@ int main(void) {

>>  }

>>  EOF

>>  

>> -    if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then

>> +    if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE $TMPC -static ; then

>>          target_compiler=""

>>      else

>>          enabled_cross_compilers="${enabled_cross_compilers} ${target_compiler}"

>> @@ -7033,6 +7036,10 @@ if test -n "$target_compiler"; then

>>    echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak

>>  fi

>>  

>> +if test -n "$target_compiler_cflags"; then

>> +  echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak

>> +fi

>> +

>>  # generate QEMU_CFLAGS/LDFLAGS for targets

>>  

>>  cflags=""

>> 



-- 
Alex Bennée
Philippe Mathieu-Daudé April 16, 2018, 10:30 a.m. UTC | #3
On 04/16/2018 06:02 AM, Alex Bennée wrote:
> 

> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> 

>> Hi Alex,

>>

>> On 04/10/2018 04:38 PM, Alex Bennée wrote:

>>> We should still be able to use the system cross compiler with the

>>> appropriate flags on x86_64 hosts.

>>>

>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>>> ---

>>>  configure | 23 +++++++++++++++--------

>>>  1 file changed, 15 insertions(+), 8 deletions(-)

>>>

>>> diff --git a/configure b/configure

>>> index b5f3b3fe29..add87ff4d4 100755

>>> --- a/configure

>>> +++ b/configure

>>> @@ -284,7 +284,6 @@ libs_softmmu=""

>>>  libs_tools=""

>>>  audio_pt_int=""

>>>  audio_win_int=""

>>> -cc_i386=i386-pc-linux-gnu-gcc

>>>  libs_qga=""

>>>  debug_info="yes"

>>>  stack_protector=""

>>> @@ -457,6 +456,8 @@ docker="no"

>>>  cross_cc_aarch64="aarch64-linux-gnu-gcc"

>>>  cross_cc_arm="arm-linux-gnueabihf-gcc"

>>>  cross_cc_powerpc="powerpc-linux-gnu-gcc"

>>> +cross_cc_i386="i386-pc-linux-gnu-gcc"

>>> +cross_cc_i386_cflags=""

>>

>> Can you keep this sorted? (arm < i386 < powerpc)

> 

> Sure.

> 

>>

>> Thanks :)

>>

>>>  

>>>  enabled_cross_compilers=""

>>>  

>>> @@ -687,12 +688,10 @@ case "$cpu" in

>>

>> What do you think about renaming $cpu -> host_cpu/target_cpu?

> 

> I'd rather avoid too much churn in configure. Maybe a separate clean-up

> patch?


Yeah me neither :S This is probably not be as trivial as it seems.

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> 

>>

>>>    i386|i486|i586|i686|i86pc|BePC)

>>>      cpu="i386"

>>>      supported_cpu="yes"

>>> -    cross_cc_i386=gcc

>>>    ;;

>>>    x86_64|amd64)

>>>      cpu="x86_64"

>>>      supported_cpu="yes"

>>> -    cross_cc_x86_64=gcc

>>>    ;;

>>>    armv*b|armv*l|arm)

>>>      cpu="arm"

>>> @@ -1435,7 +1434,6 @@ case "$cpu" in

>>>      i386)

>>>             CPU_CFLAGS="-m32"

>>>             LDFLAGS="-m32 $LDFLAGS"

>>> -           cc_i386='$(CC) -m32'

>>>             ;;

>>>      x86_64)

>>>             # ??? Only extremely old AMD cpus do not have cmpxchg16b.

>>> @@ -1443,12 +1441,14 @@ case "$cpu" in

>>>             # runtime and generate the fallback to serial emulation.

>>>             CPU_CFLAGS="-m64 -mcx16"

>>>             LDFLAGS="-m64 $LDFLAGS"

>>> -           cc_i386='$(CC) -m32'

>>> +           cross_cc_i386=$cc

>>> +           cross_cc_i386_cflags="-m32"

>>>             ;;

>>>      x32)

>>>             CPU_CFLAGS="-mx32"

>>>             LDFLAGS="-mx32 $LDFLAGS"

>>> -           cc_i386='$(CC) -m32'

>>> +           cross_cc_i386=$cc

>>> +           cross_cc_i386_cflags="-m32"

>>>             ;;

>>>      # No special flags required for other host CPUs

>>>  esac

>>> @@ -6664,7 +6664,6 @@ echo "CC=$cc" >> $config_host_mak

>>>  if $iasl -h > /dev/null 2>&1; then

>>>    echo "IASL=$iasl" >> $config_host_mak

>>>  fi

>>> -echo "CC_I386=$cc_i386" >> $config_host_mak

>>>  echo "HOST_CC=$host_cc" >> $config_host_mak

>>>  echo "CXX=$cxx" >> $config_host_mak

>>>  echo "OBJCC=$objcc" >> $config_host_mak

>>> @@ -6783,6 +6782,7 @@ case "$target" in

>>>  esac

>>>  

>>>  target_compiler=""

>>> +target_compiler_cflags=""

>>>  

>>>  mkdir -p $target_dir

>>>  echo "# Automatically generated by configure - do not modify" > $config_target_mak

>>> @@ -6799,10 +6799,13 @@ TARGET_ABI_DIR=""

>>>  case "$target_name" in

>>>    i386)

>>>      gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml"

>>> +    target_compiler=$cross_cc_i386

>>> +    target_compiler_cflags=$cross_cc_i386_cflags

>>>    ;;

>>>    x86_64)

>>>      TARGET_BASE_ARCH=i386

>>>      gdb_xml_files="i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml"

>>> +    target_compiler=$cross_cc_x86_64

>>>    ;;

>>>    alpha)

>>>      mttcg="yes"

>>> @@ -6947,7 +6950,7 @@ int main(void) {

>>>  }

>>>  EOF

>>>  

>>> -    if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then

>>> +    if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE $TMPC -static ; then

>>>          target_compiler=""

>>>      else

>>>          enabled_cross_compilers="${enabled_cross_compilers} ${target_compiler}"

>>> @@ -7033,6 +7036,10 @@ if test -n "$target_compiler"; then

>>>    echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak

>>>  fi

>>>  

>>> +if test -n "$target_compiler_cflags"; then

>>> +  echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak

>>> +fi

>>> +

>>>  # generate QEMU_CFLAGS/LDFLAGS for targets

>>>  

>>>  cflags=""

>>>

> 

>
diff mbox series

Patch

diff --git a/configure b/configure
index b5f3b3fe29..add87ff4d4 100755
--- a/configure
+++ b/configure
@@ -284,7 +284,6 @@  libs_softmmu=""
 libs_tools=""
 audio_pt_int=""
 audio_win_int=""
-cc_i386=i386-pc-linux-gnu-gcc
 libs_qga=""
 debug_info="yes"
 stack_protector=""
@@ -457,6 +456,8 @@  docker="no"
 cross_cc_aarch64="aarch64-linux-gnu-gcc"
 cross_cc_arm="arm-linux-gnueabihf-gcc"
 cross_cc_powerpc="powerpc-linux-gnu-gcc"
+cross_cc_i386="i386-pc-linux-gnu-gcc"
+cross_cc_i386_cflags=""
 
 enabled_cross_compilers=""
 
@@ -687,12 +688,10 @@  case "$cpu" in
   i386|i486|i586|i686|i86pc|BePC)
     cpu="i386"
     supported_cpu="yes"
-    cross_cc_i386=gcc
   ;;
   x86_64|amd64)
     cpu="x86_64"
     supported_cpu="yes"
-    cross_cc_x86_64=gcc
   ;;
   armv*b|armv*l|arm)
     cpu="arm"
@@ -1435,7 +1434,6 @@  case "$cpu" in
     i386)
            CPU_CFLAGS="-m32"
            LDFLAGS="-m32 $LDFLAGS"
-           cc_i386='$(CC) -m32'
            ;;
     x86_64)
            # ??? Only extremely old AMD cpus do not have cmpxchg16b.
@@ -1443,12 +1441,14 @@  case "$cpu" in
            # runtime and generate the fallback to serial emulation.
            CPU_CFLAGS="-m64 -mcx16"
            LDFLAGS="-m64 $LDFLAGS"
-           cc_i386='$(CC) -m32'
+           cross_cc_i386=$cc
+           cross_cc_i386_cflags="-m32"
            ;;
     x32)
            CPU_CFLAGS="-mx32"
            LDFLAGS="-mx32 $LDFLAGS"
-           cc_i386='$(CC) -m32'
+           cross_cc_i386=$cc
+           cross_cc_i386_cflags="-m32"
            ;;
     # No special flags required for other host CPUs
 esac
@@ -6664,7 +6664,6 @@  echo "CC=$cc" >> $config_host_mak
 if $iasl -h > /dev/null 2>&1; then
   echo "IASL=$iasl" >> $config_host_mak
 fi
-echo "CC_I386=$cc_i386" >> $config_host_mak
 echo "HOST_CC=$host_cc" >> $config_host_mak
 echo "CXX=$cxx" >> $config_host_mak
 echo "OBJCC=$objcc" >> $config_host_mak
@@ -6783,6 +6782,7 @@  case "$target" in
 esac
 
 target_compiler=""
+target_compiler_cflags=""
 
 mkdir -p $target_dir
 echo "# Automatically generated by configure - do not modify" > $config_target_mak
@@ -6799,10 +6799,13 @@  TARGET_ABI_DIR=""
 case "$target_name" in
   i386)
     gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml"
+    target_compiler=$cross_cc_i386
+    target_compiler_cflags=$cross_cc_i386_cflags
   ;;
   x86_64)
     TARGET_BASE_ARCH=i386
     gdb_xml_files="i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml"
+    target_compiler=$cross_cc_x86_64
   ;;
   alpha)
     mttcg="yes"
@@ -6947,7 +6950,7 @@  int main(void) {
 }
 EOF
 
-    if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then
+    if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE $TMPC -static ; then
         target_compiler=""
     else
         enabled_cross_compilers="${enabled_cross_compilers} ${target_compiler}"
@@ -7033,6 +7036,10 @@  if test -n "$target_compiler"; then
   echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
 fi
 
+if test -n "$target_compiler_cflags"; then
+  echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak
+fi
+
 # generate QEMU_CFLAGS/LDFLAGS for targets
 
 cflags=""