EOF
cd build
- exec $source_path/configure "$@"
+ exec "$source_path/configure" "$@"
fi
# Temporary directory used for files created while
# it when configure exits.)
TMPDIR1="config-temp"
rm -rf "${TMPDIR1}"
-mkdir -p "${TMPDIR1}"
-if [ $? -ne 0 ]; then
+if ! mkdir -p "${TMPDIR1}"; then
echo "ERROR: failed to create temporary directory"
exit 1
fi
TMPB="qemu-conf"
TMPC="${TMPDIR1}/${TMPB}.c"
TMPO="${TMPDIR1}/${TMPB}.o"
-TMPCXX="${TMPDIR1}/${TMPB}.cxx"
TMPM="${TMPDIR1}/${TMPB}.m"
TMPE="${TMPDIR1}/${TMPB}.exe"
do_compiler() {
# Run the compiler, capturing its output to the log. First argument
# is compiler binary to execute.
- local compiler="$1"
+ compiler="$1"
shift
if test -n "$BASH_VERSION"; then eval '
echo >>config.log "
do_compiler_werror "$cc" $CPU_CFLAGS "$@"
}
-do_cxx() {
- do_compiler_werror "$cxx" $CPU_CFLAGS "$@"
-}
-
do_objc() {
do_compiler_werror "$objcc" $CPU_CFLAGS "$@"
}
eval $1=\${$1:+\"\$$1 \"}\$2
}
-update_cxxflags() {
- # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those
- # options which some versions of GCC's C++ compiler complain about
- # because they only make sense for C programs.
- QEMU_CXXFLAGS="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
- CONFIGURE_CXXFLAGS=$(echo "$CONFIGURE_CFLAGS" | sed s/-std=gnu11/-std=gnu++11/)
- for arg in $QEMU_CFLAGS; do
- case $arg in
- -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\
- -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls)
- ;;
- *)
- QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg
- ;;
- esac
- done
-}
-
compile_object() {
local_cflags="$1"
do_cc $CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC
coroutine=""
plugins="$default_feature"
meson=""
-meson_args=""
ninja=""
bindir="bin"
skip_meson=no
# are included in the automatically generated help message)
# 1. Track which submodules are needed
-if test "$default_feature" = no ; then
- slirp="disabled"
-else
- slirp="auto"
-fi
fdt="auto"
# 2. Automatically enable/disable other options
printf ']\n'
}
-. $source_path/scripts/meson-buildoptions.sh
+. "$source_path/scripts/meson-buildoptions.sh"
meson_options=
meson_option_add() {
case "$opt" in
--help|-h) show_help=yes
;;
- --version|-V) exec cat $source_path/VERSION
+ --version|-V) exec cat "$source_path/VERSION"
;;
--prefix=*) prefix="$optarg"
;;
;;
--disable-tsan) tsan="no"
;;
- --disable-slirp) slirp="disabled"
- ;;
- --enable-slirp) slirp="enabled"
- ;;
- --enable-slirp=git) slirp="internal"
- ;;
- --enable-slirp=*) slirp="$optarg"
- ;;
--disable-tcg) tcg="disabled"
plugins="no"
;;
mak_wilds=""
if [ "$linux_user" != no ]; then
- if [ "$targetos" = linux ] && [ -d $source_path/linux-user/include/host/$cpu ]; then
+ if [ "$targetos" = linux ] && [ -d "$source_path/linux-user/include/host/$cpu" ]; then
linux_user=yes
elif [ "$linux_user" = yes ]; then
error_exit "linux-user not supported on this architecture"
if [ "$bsd_user" = "" ]; then
test $targetos = freebsd && bsd_user=yes
fi
- if [ "$bsd_user" = yes ] && ! [ -d $source_path/bsd-user/$targetos ]; then
+ if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$targetos" ]; then
error_exit "bsd-user not supported on this host OS"
fi
fi
fi
# Remove old dependency files to make sure that they get properly regenerated
-rm -f */config-devices.mak.d
+rm -f ./*/config-devices.mak.d
if test -z "$python"
then
"Use --python=/path/to/python to specify a supported Python."
fi
-# Preserve python version since some functionality is dependent on it
-python_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null)
-
# Suppress writing compiled files
python="$python -B"
if test -z "$meson"; then
- if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.59.3; then
+ if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.61.5; then
meson=meson
- elif test $git_submodules_action != 'ignore' ; then
+ elif test "$git_submodules_action" != 'ignore' ; then
meson=git
elif test -e "${source_path}/meson/meson.py" ; then
meson=internal
add_to nowarn_flags -Wno-typedef-redefinition
add_to nowarn_flags -Wno-tautological-type-limit-compare
add_to nowarn_flags -Wno-psabi
+add_to nowarn_flags -Wno-gnu-variable-sized-type-not-at-end
gcc_flags="$warn_flags $nowarn_flags"
cat > $TMPC << EOF
int main(int argc, char *argv[])
{
- char arr[64], *p = arr, *c = argv[0];
+ char arr[64], *p = arr, *c = argv[argc - 1];
while (*c) {
*p++ = *c++;
}
int main(void) { return tls_var; }
EOF
+# Meson currently only handles pie as a boolean for now so if we have
+# explicitly disabled PIE we need to extend our cflags because it wont.
if test "$static" = "yes"; then
if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then
CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
- QEMU_LDFLAGS="-static-pie $QEMU_LDFLAGS"
pie="yes"
elif test "$pie" = "yes"; then
error_exit "-static-pie not available due to missing toolchain support"
else
- QEMU_LDFLAGS="-static $QEMU_LDFLAGS"
pie="no"
+ QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
fi
elif test "$pie" = "no"; then
if compile_prog "-Werror -fno-pie" "-no-pie"; then
CONFIGURE_CFLAGS="-fno-pie $CONFIGURE_CFLAGS"
CONFIGURE_LDFLAGS="-no-pie $CONFIGURE_LDFLAGS"
- # Meson currently only handles pie as a boolean for now so if we have
- # explicitly disabled PIE we need to extend our cflags because it wont.
QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
fi
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
pie="no"
fi
-# Detect support for PT_GNU_RELRO + DT_BIND_NOW.
-# The combination is known as "full relro", because .got.plt is read-only too.
-if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then
- QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS"
-fi
-
##########################################
# __sync_fetch_and_and requires at least -march=i486. Many toolchains
# use i686 as default anyway, but for those that don't, an explicit
git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
fi
-# ---
+##########################################
# big/little endian test
cat > $TMPC << EOF
-#include <stdio.h>
-short big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, };
-short little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, };
-int main(int argc, char *argv[])
-{
- return printf("%s %s\n", (char *)big_endian, (char *)little_endian);
-}
+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# error LITTLE
+#endif
+int main(void) { return 0; }
EOF
-if compile_prog ; then
- if strings -a $TMPE | grep -q BiGeNdIaN ; then
- bigendian="yes"
- elif strings -a $TMPE | grep -q LiTtLeEnDiAn ; then
- bigendian="no"
- else
- echo big/little test failed
- exit 1
- fi
+if ! compile_prog ; then
+ bigendian="no"
else
+ cat > $TMPC << EOF
+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+# error BIG
+#endif
+int main(void) { return 0; }
+EOF
+
+ if ! compile_prog ; then
+ bigendian="yes"
+ else
echo big/little test failed
exit 1
+ fi
fi
##########################################
if test "$safe_stack" = "yes"; then
cat > $TMPC << EOF
-int main(int argc, char *argv[])
+int main(void)
{
#if ! __has_feature(safe_stack)
#error SafeStack Disabled
fi
else
cat > $TMPC << EOF
-int main(int argc, char *argv[])
+int main(void)
{
#if defined(__has_feature)
#if __has_feature(safe_stack)
#define TAUT(X) ((X) == Z)
#define PAREN(X, Y) (X == Y)
#define ID(X) (X)
-int main(int argc, char *argv[])
+int main(void)
{
int x = 0, y = 0;
x = ID(x);
fi
fi
-##########################################
-# check for slirp
-
-case "$slirp" in
- auto | enabled | internal)
- # Simpler to always update submodule, even if not needed.
- git_submodules="${git_submodules} slirp"
- ;;
-esac
-
##########################################
# functions to probe cross compilers
container="no"
-if test $use_containers = "yes"; then
- if has "docker" || has "podman"; then
- container=$($python $source_path/tests/docker/docker.py probe)
+if test $use_containers = "yes" && (has "docker" || has "podman"); then
+ case $($python "$source_path"/tests/docker/docker.py probe) in
+ *docker) container=docker ;;
+ podman) container=podman ;;
+ no) container=no ;;
+ esac
+ if test "$container" != "no"; then
+ docker_py="$python $source_path/tests/docker/docker.py --engine $container"
fi
fi
fi
}
+have_target() {
+ for i; do
+ case " $target_list " in
+ *" $i "*) return 0;;
+ *) ;;
+ esac
+ done
+ return 1
+}
+
# probe_target_compiler TARGET
#
# Look for a compiler for the given target, either native or cross.
container_cross_ranlib=
container_cross_strip=
+ # We shall skip configuring the target compiler if the user didn't
+ # bother enabling an appropriate guest. This avoids building
+ # extraneous firmware images and tests.
+ if test "${target_list#*$1}" != "$1"; then
+ break;
+ else
+ return 1
+ fi
+
target_arch=${1%%-*}
case $target_arch in
aarch64) container_hosts="x86_64 aarch64" ;;
: ${container_cross_strip:=${container_cross_prefix}strip}
done
- local t try
try=cross
case "$target_arch:$cpu" in
aarch64_be:aarch64 | \
try='native cross' ;;
esac
eval "target_cflags=\${cross_cc_cflags_$target_arch}"
- for t in $try; do
- case $t in
+ for thistry in $try; do
+ case $thistry in
native)
target_cc=$cc
target_ccas=$ccas
target_ranlib=
target_strip=
fi
+ test -n "$target_cc"
}
write_target_makefile() {
echo "EXTRA_CFLAGS=$target_cflags"
- if test -n "$target_cc"; then
- echo "CC=$target_cc"
- echo "CCAS=$target_ccas"
- fi
- if test -n "$target_ar"; then
- echo "AR=$target_ar"
- fi
- if test -n "$target_as"; then
- echo "AS=$target_as"
- fi
- if test -n "$target_ld"; then
- echo "LD=$target_ld"
- fi
- if test -n "$target_nm"; then
- echo "NM=$target_nm"
- fi
- if test -n "$target_objcopy"; then
- echo "OBJCOPY=$target_objcopy"
- fi
- if test -n "$target_ranlib"; then
- echo "RANLIB=$target_ranlib"
- fi
- if test -n "$target_strip"; then
- echo "STRIP=$target_strip"
- fi
-}
-
-write_container_target_makefile() {
- echo "EXTRA_CFLAGS=$target_cflags"
- if test -n "$container_cross_cc"; then
- echo "CC=\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
- echo "CCAS=\$(DOCKER_SCRIPT) cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
+ if test -z "$target_cc" && test -z "$target_as"; then
+ test -z "$container_image" && error_exit "Internal error: could not find cross compiler for $1?"
+ echo "$1: docker-image-$container_image" >> Makefile.prereqs
+ if test -n "$container_cross_cc"; then
+ echo "CC=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
+ echo "CCAS=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --"
+ fi
+ echo "AR=$docker_py cc --cc $container_cross_ar -i qemu/$container_image -s $source_path --"
+ echo "AS=$docker_py cc --cc $container_cross_as -i qemu/$container_image -s $source_path --"
+ echo "LD=$docker_py cc --cc $container_cross_ld -i qemu/$container_image -s $source_path --"
+ echo "NM=$docker_py cc --cc $container_cross_nm -i qemu/$container_image -s $source_path --"
+ echo "OBJCOPY=$docker_py cc --cc $container_cross_objcopy -i qemu/$container_image -s $source_path --"
+ echo "RANLIB=$docker_py cc --cc $container_cross_ranlib -i qemu/$container_image -s $source_path --"
+ echo "STRIP=$docker_py cc --cc $container_cross_strip -i qemu/$container_image -s $source_path --"
+ else
+ if test -n "$target_cc"; then
+ echo "CC=$target_cc"
+ echo "CCAS=$target_ccas"
+ fi
+ if test -n "$target_ar"; then
+ echo "AR=$target_ar"
+ fi
+ if test -n "$target_as"; then
+ echo "AS=$target_as"
+ fi
+ if test -n "$target_ld"; then
+ echo "LD=$target_ld"
+ fi
+ if test -n "$target_nm"; then
+ echo "NM=$target_nm"
+ fi
+ if test -n "$target_objcopy"; then
+ echo "OBJCOPY=$target_objcopy"
+ fi
+ if test -n "$target_ranlib"; then
+ echo "RANLIB=$target_ranlib"
+ fi
+ if test -n "$target_strip"; then
+ echo "STRIP=$target_strip"
+ fi
fi
- echo "AR=\$(DOCKER_SCRIPT) cc --cc $container_cross_ar -i qemu/$container_image -s $source_path --"
- echo "AS=\$(DOCKER_SCRIPT) cc --cc $container_cross_as -i qemu/$container_image -s $source_path --"
- echo "LD=\$(DOCKER_SCRIPT) cc --cc $container_cross_ld -i qemu/$container_image -s $source_path --"
- echo "NM=\$(DOCKER_SCRIPT) cc --cc $container_cross_nm -i qemu/$container_image -s $source_path --"
- echo "OBJCOPY=\$(DOCKER_SCRIPT) cc --cc $container_cross_objcopy -i qemu/$container_image -s $source_path --"
- echo "RANLIB=\$(DOCKER_SCRIPT) cc --cc $container_cross_ranlib -i qemu/$container_image -s $source_path --"
- echo "STRIP=\$(DOCKER_SCRIPT) cc --cc $container_cross_strip -i qemu/$container_image -s $source_path --"
}
-
-
##########################################
# check for vfio_user_server
fi
##########################################
-
-# Exclude --warn-common with TSan to suppress warnings from the TSan libraries.
-if test "$solaris" = "no" && test "$tsan" = "no"; then
- if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
- QEMU_LDFLAGS="-Wl,--warn-common $QEMU_LDFLAGS"
- fi
-fi
-
# Guest agent Windows MSI package
if test "$QEMU_GA_MANUFACTURER" = ""; then
QEMU_GA_DISTRO=Linux
fi
if test "$QEMU_GA_VERSION" = ""; then
- QEMU_GA_VERSION=$(cat $source_path/VERSION)
+ QEMU_GA_VERSION=$(cat "$source_path"/VERSION)
fi
# tests might fail. Prefer to keep the relevant files in their own
# directory and symlink the directory instead.
LINKS="Makefile"
-LINKS="$LINKS tests/tcg/Makefile.target"
LINKS="$LINKS pc-bios/optionrom/Makefile"
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
LINKS="$LINKS pc-bios/vof/Makefile"
LINKS="$LINKS contrib/plugins/Makefile "
for f in $LINKS ; do
if [ -e "$source_path/$f" ]; then
- mkdir -p `dirname ./$f`
+ mkdir -p "$(dirname ./"$f")"
symlink "$source_path/$f" "$f"
fi
done
+echo "# Automatically generated by configure - do not modify" > Makefile.prereqs
+
# Mac OS X ships with a broken assembler
roms=
-probe_target_compiler i386-softmmu
-if test -n "$target_cc" &&
+if have_target i386-softmmu x86_64-softmmu && \
test "$targetos" != "darwin" && test "$targetos" != "sunos" && \
- test "$targetos" != "haiku" && test "$softmmu" = yes ; then
- # Different host OS linkers have different ideas about the name of the ELF
- # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd
- # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe.
- for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do
- if "$target_ld" -verbose 2>&1 | grep -q "^[[:space:]]*${emu}[[:space:]]*$"; then
- ld_i386_emulation="$emu"
- break
- fi
- done
- if test -n "$ld_i386_emulation"; then
- roms="pc-bios/optionrom"
- config_mak=pc-bios/optionrom/config.mak
- echo "# Automatically generated by configure - do not modify" > $config_mak
- echo "TOPSRC_DIR=$source_path" >> $config_mak
- echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_mak
- write_target_makefile >> $config_mak
- fi
+ test "$targetos" != "haiku" && \
+ probe_target_compiler i386-softmmu; then
+ roms="pc-bios/optionrom"
+ config_mak=pc-bios/optionrom/config.mak
+ echo "# Automatically generated by configure - do not modify" > $config_mak
+ echo "TOPSRC_DIR=$source_path" >> $config_mak
+ write_target_makefile >> $config_mak
fi
-probe_target_compiler ppc-softmmu
-if test -n "$target_cc" && test "$softmmu" = yes; then
+if have_target ppc-softmmu ppc64-softmmu && \
+ probe_target_compiler ppc-softmmu; then
roms="$roms pc-bios/vof"
config_mak=pc-bios/vof/config.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
# Only build s390-ccw bios if the compiler has -march=z900 or -march=z10
# (which is the lowest architecture level that Clang supports)
-probe_target_compiler s390x-softmmu
-if test -n "$target_cc" && test "$softmmu" = yes; then
+if have_target s390x-softmmu && probe_target_compiler s390x-softmmu; then
write_c_skeleton
do_compiler "$target_cc" $target_cc_cflags -march=z900 -o $TMPO -c $TMPC
has_z900=$?
#######################################
# generate config-host.mak
-# Check that the C++ compiler exists and works with the C compiler.
-# All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added.
-if has $cxx; then
- cat > $TMPC <<EOF
-int c_function(void);
-int main(void) { return c_function(); }
-EOF
-
- compile_object
-
- cat > $TMPCXX <<EOF
-extern "C" {
- int c_function(void);
-}
-int c_function(void) { return 42; }
-EOF
-
- update_cxxflags
-
- if do_cxx $CXXFLAGS $EXTRA_CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then
- # C++ compiler $cxx works ok with C compiler $cc
- :
- else
- echo "C++ compiler $cxx does not work with C compiler $cc"
- echo "Disabling C++ specific optional code"
- cxx=
- fi
-else
- echo "No C++ compiler available; disabling C++ specific optional code"
- cxx=
-fi
-
if ! (GIT="$git" "$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then
exit 1
fi
gdb_version=$($gdb_bin --version | head -n 1)
if version_ge ${gdb_version##* } 9.1; then
echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak
+ else
+ gdb_bin=""
fi
fi
+if test "$container" != no; then
+ echo "ENGINE=$container" >> $config_host_mak
+fi
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "PYTHON=$python" >> $config_host_mak
echo "NINJA=$ninja" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
-echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
for target in $target_list; do
target_dir="$target"
target_name=$(echo $target | cut -d '-' -f 1)$EXESUF
- mkdir -p $target_dir
+ mkdir -p "$target_dir"
case $target in
*-user) symlink "../qemu-$target_name" "$target_dir/qemu-$target_name" ;;
*) symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" ;;
fi
# tests/tcg configuration
-(makefile=tests/tcg/Makefile.prereqs
-echo "# Automatically generated by configure - do not modify" > $makefile
-
-config_host_mak=tests/tcg/config-host.mak
+(config_host_mak=tests/tcg/config-host.mak
+mkdir -p tests/tcg
echo "# Automatically generated by configure - do not modify" > $config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak
+# versioned checked in the main config_host.mak above
+if test -n "$gdb_bin"; then
+ echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak
+fi
+if test "$plugins" = "yes" ; then
+ echo "CONFIG_PLUGIN=y" >> $config_host_mak
+fi
+
tcg_tests_targets=
for target in $target_list; do
arch=${target%%-*}
- config_target_mak=tests/tcg/config-$target.mak
-
- echo "# Automatically generated by configure - do not modify" > $config_target_mak
- echo "TARGET_NAME=$arch" >> $config_target_mak
case $target in
xtensa*-linux-user)
# the toolchain is not complete with headers, only build softmmu tests
continue
;;
*-softmmu)
- test -f $source_path/tests/tcg/$arch/Makefile.softmmu-target || continue
+ test -f "$source_path/tests/tcg/$arch/Makefile.softmmu-target" || continue
qemu="qemu-system-$arch"
;;
*-linux-user|*-bsd-user)
;;
esac
- probe_target_compiler $target
- 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.
-
- echo "BUILD_STATIC=$build_static" >> $config_target_mak
- write_target_makefile >> $config_target_mak
- case $target in
- aarch64-*)
- if do_compiler "$target_cc" $target_cflags \
- -march=armv8.1-a+sve -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
- fi
- if do_compiler "$target_cc" $target_cflags \
- -march=armv8.1-a+sve2 -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_SVE2=y" >> $config_target_mak
- fi
- if do_compiler "$target_cc" $target_cflags \
- -march=armv8.3-a -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
- fi
- if do_compiler "$target_cc" $target_cflags \
- -mbranch-protection=standard -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
- fi
- if do_compiler "$target_cc" $target_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_cc" $target_cflags \
- -mpower8-vector -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
- fi
- if do_compiler "$target_cc" $target_cflags \
- -mpower10 -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_POWER10=y" >> $config_target_mak
- fi
- ;;
- i386-linux-user)
- if do_compiler "$target_cc" $target_cflags \
- -Werror -fno-pie -o $TMPE $TMPC; then
- echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
- fi
- ;;
- esac
- elif test -n "$container_image"; then
- echo "build-tcg-tests-$target: docker-image-$container_image" >> $makefile
- echo "BUILD_STATIC=y" >> $config_target_mak
- write_container_target_makefile >> $config_target_mak
- case $target in
- aarch64-*)
- echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
- echo "CROSS_CC_HAS_SVE2=y" >> $config_target_mak
- echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
- echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
- echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak
- ;;
- ppc*)
- echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
- echo "CROSS_CC_HAS_POWER10=y" >> $config_target_mak
- ;;
- i386-linux-user)
- echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
- ;;
- esac
- got_cross_cc=yes
- fi
- if test $got_cross_cc = yes; then
- mkdir -p tests/tcg/$target
- echo "QEMU=$PWD/$qemu" >> $config_target_mak
- echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile
+ if probe_target_compiler $target || test -n "$container_image"; then
+ test -n "$container_image" && build_static=y
+ mkdir -p "tests/tcg/$target"
+ config_target_mak=tests/tcg/$target/config-target.mak
+ ln -sf "$source_path/tests/tcg/Makefile.target" "tests/tcg/$target/Makefile"
+ echo "# Automatically generated by configure - do not modify" > "$config_target_mak"
+ echo "TARGET_NAME=$arch" >> "$config_target_mak"
+ echo "TARGET=$target" >> "$config_target_mak"
+ write_target_makefile "build-tcg-tests-$target" >> "$config_target_mak"
+ echo "BUILD_STATIC=$build_static" >> "$config_target_mak"
+ echo "QEMU=$PWD/$qemu" >> "$config_target_mak"
+ echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs
tcg_tests_targets="$tcg_tests_targets $target"
fi
done
-echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> $makefile)
+echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> config-host.mak)
if test "$skip_meson" = no; then
cross="config-meson.cross.new"
echo "${a}-softmmu = '$c'" >> $cross
done
- test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross
echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross
test "$fdt" != auto && meson_option_add "-Dfdt=$fdt"
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
test "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix"
- test "$slirp" != auto && meson_option_add "-Dslirp=$slirp"
test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
test "$vfio_user_server" != auto && meson_option_add "-Dvfio_user_server=$vfio_user_server"