aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/configure.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/configure.sh')
-rwxr-xr-xtests/tcg/configure.sh207
1 files changed, 107 insertions, 100 deletions
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 8f20ce065d..ed6492ce59 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -74,37 +74,17 @@ fi
for target in $target_list; do
arch=${target%%-*}
- case $arch in
- arm|armeb)
- arches=arm
- ;;
- aarch64|aarch64_be)
- arches="aarch64 arm"
- ;;
- mips*)
- arches=mips
- ;;
- ppc*)
- arches=ppc
- ;;
- sh4|sh4eb)
- arches=sh4
- ;;
- x86_64)
- arches="x86_64 i386"
- ;;
- xtensa|xtensaeb)
- arches=xtensa
- ;;
- alpha|cris|hexagon|hppa|i386|microblaze|microblazeel|m68k|openrisc|riscv64|s390x|sh4|sparc64)
- arches=$target
- ;;
- *)
- continue
- ;;
- esac
+ # reset all container fields
container_image=
+ container_hosts=
+ container_cross_cc=
+ container_cross_as=
+ container_cross_ld=
+
+ # suppress clang
+ supress_clang=
+
case $target in
aarch64-*)
# We don't have any bigendian build tools so we only use this for AArch64
@@ -128,6 +108,11 @@ for target in $target_list; do
container_image=fedora-cris-cross
container_cross_cc=cris-linux-gnu-gcc
;;
+ hexagon-*)
+ container_hosts=x86_64
+ container_image=debian-hexagon-cross
+ container_cross_cc=hexagon-unknown-linux-musl-clang
+ ;;
hppa-*)
container_hosts=x86_64
container_image=debian-hppa-cross
@@ -137,6 +122,7 @@ for target in $target_list; do
container_hosts=x86_64
container_image=fedora-i386-cross
container_cross_cc=gcc
+ supress_clang=yes
;;
m68k-*)
container_hosts=x86_64
@@ -165,18 +151,14 @@ for target in $target_list; do
;;
ppc-*|ppc64abi32-*)
container_hosts=x86_64
- container_image=debian-powerpc-cross
- container_cross_cc=powerpc-linux-gnu-gcc
- ;;
- ppc64-*)
- container_hosts=x86_64
- container_image=debian-ppc64-cross
- container_cross_cc=powerpc64-linux-gnu-gcc
+ container_image=debian-powerpc-test-cross
+ container_cross_cc=powerpc-linux-gnu-gcc-10
;;
- ppc64le-*)
+ ppc64-*|ppc64le-*)
container_hosts=x86_64
- container_image=debian-ppc64el-cross
- container_cross_cc=powerpc64le-linux-gnu-gcc
+ container_image=debian-powerpc-test-cross
+ container_cross_cc=${target%%-*}-linux-gnu-gcc-10
+ container_cross_cc=powerpc${container_cross_cc#ppc}
;;
riscv64-*)
container_hosts=x86_64
@@ -198,10 +180,17 @@ for target in $target_list; do
container_image=debian-sparc64-cross
container_cross_cc=sparc64-linux-gnu-gcc
;;
+ tricore-softmmu)
+ container_hosts=x86_64
+ container_image=debian-tricore-cross
+ container_cross_as=tricore-as
+ container_cross_ld=tricore-ld
+ ;;
x86_64-*)
container_hosts="aarch64 ppc64el x86_64"
container_image=debian-amd64-cross
container_cross_cc=x86_64-linux-gnu-gcc
+ supress_clang=yes
;;
xtensa*-softmmu)
container_hosts=x86_64
@@ -216,6 +205,7 @@ for target in $target_list; do
echo "# Automatically generated by configure - do not modify" > $config_target_mak
echo "TARGET_NAME=$arch" >> $config_target_mak
+ echo "target=$target" >> $config_target_mak
case $target in
*-linux-user | *-bsd-user)
echo "CONFIG_USER_ONLY=y" >> $config_target_mak
@@ -231,74 +221,91 @@ for target in $target_list; do
echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak
got_cross_cc=no
- for i in $arch $arches; do
- if eval test "x\${cross_cc_$i+yes}" != xyes; then
- continue
- fi
- eval "target_compiler=\${cross_cc_$i}"
- if ! has $target_compiler; then
- continue
- fi
- write_c_skeleton
- 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" $target_compiler_cflags -o $TMPE $TMPC ; then
- continue
- fi
- echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
- else
- echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
- fi
- echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
+ if eval test "x\${cross_cc_$arch}" != xyes; then
+ eval "target_compiler=\${cross_cc_$arch}"
- # Test for compiler features for optional tests. We only do this
- # for cross compilers because ensuring the docker containers based
- # compilers is a requirememt for adding a new test that needs a
- # compiler feature.
- case $target in
- aarch64-*)
- if do_compiler "$target_compiler" $target_compiler_cflags \
- -march=armv8.1-a+sve -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
- fi
- if do_compiler "$target_compiler" $target_compiler_cflags \
- -march=armv8.3-a -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
- fi
- if do_compiler "$target_compiler" $target_compiler_cflags \
- -mbranch-protection=standard -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
- fi
- if do_compiler "$target_compiler" $target_compiler_cflags \
- -march=armv8.5-a+memtag -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak
- fi
- ;;
- ppc*)
- if do_compiler "$target_compiler" $target_compiler_cflags \
- -mpower8-vector -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
- fi
- ;;
- i386-linux-user)
- if do_compiler "$target_compiler" $target_compiler_cflags \
- -Werror -fno-pie -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
- fi
- ;;
- esac
+ if has "$target_compiler"; then
+ if test "$supress_clang" = yes &&
+ $target_compiler --version | grep -qi "clang"; then
+ got_cross_cc=no
+ else
+ write_c_skeleton
+ 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" $target_compiler_cflags \
+ -o $TMPE $TMPC ; then
+ got_cross_cc=yes
+ echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
+ echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
+ fi
+ else
+ got_cross_cc=yes
+ echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
+ echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
+ fi
+ fi
+ fi
+ fi
- enabled_cross_compilers="$enabled_cross_compilers $target_compiler"
- got_cross_cc=yes
- break
- done
+ if test $got_cross_cc = yes; then
+ # Test for compiler features for optional tests. We only do this
+ # for cross compilers because ensuring the docker containers based
+ # compilers is a requirememt for adding a new test that needs a
+ # compiler feature.
- if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
+ case $target in
+ aarch64-*)
+ if do_compiler "$target_compiler" $target_compiler_cflags \
+ -march=armv8.1-a+sve -o $TMPE $TMPC; then
+ echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
+ fi
+ if do_compiler "$target_compiler" $target_compiler_cflags \
+ -march=armv8.3-a -o $TMPE $TMPC; then
+ echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
+ fi
+ if do_compiler "$target_compiler" $target_compiler_cflags \
+ -mbranch-protection=standard -o $TMPE $TMPC; then
+ echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
+ fi
+ if do_compiler "$target_compiler" $target_compiler_cflags \
+ -march=armv8.5-a+memtag -o $TMPE $TMPC; then
+ echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak
+ fi
+ ;;
+ ppc*)
+ if do_compiler "$target_compiler" $target_compiler_cflags \
+ -mpower8-vector -o $TMPE $TMPC; then
+ echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
+ fi
+ if do_compiler "$target_compiler" $target_compiler_cflags \
+ -mpower10 -o $TMPE $TMPC; then
+ echo "CROSS_CC_HAS_POWER10=y" >> $config_target_mak
+ fi
+ ;;
+ i386-linux-user)
+ if do_compiler "$target_compiler" $target_compiler_cflags \
+ -Werror -fno-pie -o $TMPE $TMPC; then
+ echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
+ fi
+ ;;
+ esac
+ elif test $got_cross_cc = no && test "$container" != no && \
+ test -n "$container_image"; then
for host in $container_hosts; do
if test "$host" = "$ARCH"; then
echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
- echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
+ echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> \
+ $config_target_mak
+ if test -n "$container_cross_as"; then
+ echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> \
+ $config_target_mak
+ fi
+ if test -n "$container_cross_ld"; then
+ echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >> \
+ $config_target_mak
+ fi
fi
done
fi