[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 04/49] configure: move i386_cc to cross_cc_i386
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v4 04/49] configure: move i386_cc to cross_cc_i386 |
Date: |
Thu, 17 May 2018 18:46:33 +0100 |
Also dont assume x86_64 compiler can build i386 binaries.
Signed-off-by: Alex Bennée <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
v2
- drop using system x86_64 compiler for i386 compiles
v3
- fix cross_cc_i386 when on i386
v4
- fix merge conflicts
- sort cross_cc defines
---
configure | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/configure b/configure
index b21e6ce6ac..52a5d747e4 100755
--- a/configure
+++ b/configure
@@ -289,7 +289,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=""
@@ -461,6 +460,8 @@ docker="no"
# cross compilers defaults, can be overridden with --cross-cc-ARCH
cross_cc_aarch64="aarch64-linux-gnu-gcc"
cross_cc_arm="arm-linux-gnueabihf-gcc"
+cross_cc_i386="i386-pc-linux-gnu-gcc"
+cross_cc_cflags_i386=""
cross_cc_powerpc="powerpc-linux-gnu-gcc"
enabled_cross_compilers=""
@@ -1447,7 +1448,8 @@ case "$cpu" in
i386)
CPU_CFLAGS="-m32"
LDFLAGS="-m32 $LDFLAGS"
- cc_i386='$(CC) -m32'
+ cross_cc_i386=$cc
+ cross_cc_cflags_i386=$CPU_CFLAGS
;;
x86_64)
# ??? Only extremely old AMD cpus do not have cmpxchg16b.
@@ -1455,12 +1457,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_x86_64=$cc
+ cross_cc_cflags_x86_64=$CPU_CFLAGS
;;
x32)
CPU_CFLAGS="-mx32"
LDFLAGS="-mx32 $LDFLAGS"
- cc_i386='$(CC) -m32'
+ cross_cc_i386=$cc
+ cross_cc_cflags_i386="-m32"
;;
# No special flags required for other host CPUs
esac
@@ -6714,7 +6718,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
@@ -6835,6 +6838,7 @@ esac
target_compiler=""
target_compiler_static=""
+target_compiler_cflags=""
mkdir -p $target_dir
echo "# Automatically generated by configure - do not modify" >
$config_target_mak
@@ -6852,6 +6856,7 @@ 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_ccflags_i386
;;
x86_64)
TARGET_BASE_ARCH=i386
@@ -7023,9 +7028,9 @@ if has $target_compiler; then
write_c_skeleton
- if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then
+ if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE $TMPC
-static ; then
# For host systems we might get away with building without -static
- if ! do_compiler $target_compiler -o $TMPE $TMPC ; then
+ if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE
$TMPC ; then
target_compiler=""
else
enabled_cross_compilers="${enabled_cross_compilers}
${target_compiler}"
@@ -7118,8 +7123,13 @@ if test -n "$target_compiler"; then
if test -n "$target_compiler_static"; then
echo "CROSS_CC_GUEST_STATIC=$target_compiler_static" >>
$config_target_mak
fi
+
+ if test -n "$target_compiler_cflags"; then
+ echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >>
$config_target_mak
+ fi
fi
+
# generate QEMU_CFLAGS/LDFLAGS for targets
cflags=""
--
2.17.0
- [Qemu-devel] [PATCH v4 00/49] fix building of tests/tcg, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 02/49] configure: add test for docker availability, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 01/49] docker: add "probe" command for configure, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 04/49] configure: move i386_cc to cross_cc_i386,
Alex Bennée <=
- [Qemu-devel] [PATCH v4 05/49] configure: allow user to specify --cross-cc-cflags-foo=, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 06/49] configure: set cross_cc_FOO for host compiler, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 10/49] docker: allow "cc" command to run in user context, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 07/49] Makefile: Rename TARGET_DIRS to TARGET_LIST, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 11/49] docker: Makefile.include introduce DOCKER_SCRIPT, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 03/49] configure: add support for --cross-cc-FOO, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 12/49] tests/tcg: move architecture independent tests into subdir, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 08/49] docker: Add "cc" subcommand, Alex Bennée, 2018/05/17
- [Qemu-devel] [PATCH v4 09/49] docker: extend "cc" command to accept compiler, Alex Bennée, 2018/05/17