[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 02/44] configure: Distinguish ppc64 and ppc64le hosts
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 02/44] configure: Distinguish ppc64 and ppc64le hosts |
Date: |
Wed, 29 May 2019 16:49:35 +1000 |
From: Richard Henderson <address@hidden>
We cannot use the ppc64le host compiler to build ppc64(be) guest code.
Clean up confusion between cross_cc_powerpc and cross_cc_ppc; make use
of the cflags variable as well.
Signed-off-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
[dwg: Dropped hunk relating to ppc64abi32, it doesn't test properly]
Signed-off-by: David Gibson <address@hidden>
---
configure | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/configure b/configure
index 528b9ff705..07eb2b3942 100755
--- a/configure
+++ b/configure
@@ -198,7 +198,7 @@ supported_kvm_target() {
i386:i386 | i386:x86_64 | i386:x32 | \
x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \
mips:mips | mipsel:mips | \
- ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | \
+ ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | ppc64:ppc64le | \
s390x:s390x)
return 0
;;
@@ -502,8 +502,11 @@ cross_cc_arm="arm-linux-gnueabihf-gcc"
cross_cc_cflags_armeb="-mbig-endian"
cross_cc_i386="i386-pc-linux-gnu-gcc"
cross_cc_cflags_i386=""
-cross_cc_powerpc="powerpc-linux-gnu-gcc"
-cross_cc_powerpc="powerpc-linux-gnu-gcc"
+cross_cc_ppc="powerpc-linux-gnu-gcc"
+cross_cc_cflags_ppc="-m32"
+cross_cc_ppc64="powerpc-linux-gnu-gcc"
+cross_cc_cflags_ppc64="-m64"
+cross_cc_ppc64le="powerpc64le-linux-gnu-gcc"
enabled_cross_compilers=""
@@ -700,7 +703,11 @@ elif check_define __sparc__ ; then
fi
elif check_define _ARCH_PPC ; then
if check_define _ARCH_PPC64 ; then
- cpu="ppc64"
+ if check_define _LITTLE_ENDIAN ; then
+ cpu="ppc64le"
+ else
+ cpu="ppc64"
+ fi
else
cpu="ppc"
fi
@@ -731,10 +738,14 @@ ARCH=
# Note that this case should only have supported host CPUs, not guests.
case "$cpu" in
ppc|ppc64|s390|s390x|sparc64|x32|riscv32|riscv64)
- cpu="$cpu"
supported_cpu="yes"
eval "cross_cc_${cpu}=\$host_cc"
;;
+ ppc64le)
+ ARCH="ppc64"
+ supported_cpu="yes"
+ cross_cc_ppc64le=$host_cc
+ ;;
i386|i486|i586|i686|i86pc|BePC)
cpu="i386"
supported_cpu="yes"
@@ -1538,8 +1549,8 @@ case "$cpu" in
ppc)
CPU_CFLAGS="-m32"
LDFLAGS="-m32 $LDFLAGS"
- cross_cc_powerpc=$cc
- cross_cc_cflags_powerpc=$CPU_CFLAGS
+ cross_cc_ppc=$cc
+ cross_cc_cflags_ppc="$CPU_CFLAGS"
;;
ppc64)
CPU_CFLAGS="-m64"
@@ -6191,7 +6202,7 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } &&
\
fi
done
fi
-if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" ; then
+if test "$ARCH" = "ppc64" && test "$targetos" != "Darwin" ; then
roms="$roms spapr-rtas"
fi
@@ -7378,7 +7389,7 @@ if test "$linux" = "yes" ; then
i386|x86_64|x32)
linux_arch=x86
;;
- ppc|ppc64)
+ ppc|ppc64|ppc64le)
linux_arch=powerpc
;;
s390x)
@@ -7539,7 +7550,8 @@ case "$target_name" in
;;
ppc)
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml
power-spe.xml"
- target_compiler=$cross_cc_powerpc
+ target_compiler=$cross_cc_ppc
+ target_compiler_cflags="$cross_cc_cflags_ppc"
;;
ppc64)
TARGET_BASE_ARCH=ppc
@@ -7547,6 +7559,7 @@ case "$target_name" in
mttcg=yes
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml
power-spe.xml power-vsx.xml"
target_compiler=$cross_cc_ppc64
+ target_compiler_cflags="$cross_cc_cflags_ppc64"
;;
ppc64le)
TARGET_ARCH=ppc64
--
2.21.0
- [Qemu-ppc] [PULL 00/44] ppc-for-4.1 queue 20190529, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 01/44] tests: Fix up docker cross builds for ppc64 (BE) targets, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 03/44] configure: Use quotes around uses of $CPU_CFLAGS, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 02/44] configure: Distinguish ppc64 and ppc64le hosts,
David Gibson <=
- [Qemu-ppc] [PULL 05/44] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 08/44] target/ppc: Add ibm, purr and ibm, spurr device-tree properties, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 04/44] target/ppc/kvm: Fix trace typo, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 10/44] target/ppc: Fix xxbrq, xxbrw, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 14/44] spapr/xive: EQ page should be naturally aligned, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 13/44] target/ppc: Fix xxspltib, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 15/44] spapr/xive: fix EQ page addresses above 64GB, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 07/44] hw/ppc/40p: use 1900 as a base year, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 06/44] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs, David Gibson, 2019/05/29
- [Qemu-ppc] [PULL 12/44] target/ppc: Fix vsum2sws, David Gibson, 2019/05/29