return 1
}
+supported_hvf_target() {
+ test "$hvf" = "yes" || return 1
+ glob "$1" "*-softmmu" || return 1
+ case "${1%-softmmu}" in
+ x86_64)
+ return 0
+ ;;
+ esac
+ return 1
+}
+
supported_target() {
case "$1" in
*-softmmu)
supported_kvm_target "$1" && return 0
supported_xen_target "$1" && return 0
supported_hax_target "$1" && return 0
+ supported_hvf_target "$1" && return 0
print_error "TCG disabled, but hardware accelerator not available for '$target'"
return 1
}
vhost_user=""
kvm="no"
hax="no"
+hvf="no"
rdma=""
gprof="no"
debug_tcg="no"
supported_cpu="no"
supported_os="no"
bogus_os="no"
+malloc_trim=""
# parse CC options first
for opt do
bsd="yes"
darwin="yes"
hax="yes"
+ hvf="yes"
LDFLAGS_SHARED="-bundle -undefined dynamic_lookup"
if [ "$cpu" = "x86_64" ] ; then
QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
;;
--enable-hax) hax="yes"
;;
+ --disable-hvf) hvf="no"
+ ;;
+ --enable-hvf) hvf="yes"
+ ;;
--disable-tcg-interpreter) tcg_interpreter="no"
;;
--enable-tcg-interpreter) tcg_interpreter="yes"
;;
--enable-tcg) tcg="yes"
;;
+ --disable-malloc-trim) malloc_trim="no"
+ ;;
+ --enable-malloc-trim) malloc_trim="yes"
+ ;;
--disable-spice) spice="no"
;;
--enable-spice) spice="yes"
Default:trace-<pid>
--disable-slirp disable SLIRP userspace network connectivity
--enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)
+ --enable-malloc-trim enable libc malloc_trim() for memory optimization
--oss-lib path to OSS library
--cpu=CPU Build for host CPU [$cpu]
--with-coroutine=BACKEND coroutine backend. Supported options:
bluez bluez stack connectivity
kvm KVM acceleration support
hax HAX acceleration support
+ hvf Hypervisor.framework acceleration support
rdma RDMA-based migration support
vde support for vde network
netmap support for netmap network
done
if test "$found" = "no"; then
LIBS="$pthread_lib $LIBS"
+ libs_qga="$pthread_lib $libs_qga"
fi
PTHREAD_LIB="$pthread_lib"
break
exit 1
fi
+# Even if malloc_trim() is available, these non-libc memory allocators
+# do not support it.
+if test "$tcmalloc" = "yes" || test "$jemalloc" = "yes" ; then
+ if test "$malloc_trim" = "yes" ; then
+ echo "Disabling malloc_trim with non-libc memory allocator"
+ fi
+ malloc_trim="no"
+fi
+
+#######################################
+# malloc_trim
+
+if test "$malloc_trim" != "no" ; then
+ cat > $TMPC << EOF
+#include <malloc.h>
+int main(void) { malloc_trim(0); return 0; }
+EOF
+ if compile_prog "" "" ; then
+ malloc_trim="yes"
+ else
+ malloc_trim="no"
+ fi
+fi
+
##########################################
# tcmalloc probe
# check if memfd is supported
memfd=no
cat > $TMPC << EOF
-#include <sys/memfd.h>
+#include <sys/mman.h>
int main(void)
{
fi
+#################################################
+# Check to see if we have the Hypervisor framework
+if [ "$darwin" = "yes" ] ; then
+ cat > $TMPC << EOF
+#include <Hypervisor/hv.h>
+int main() { return 0;}
+EOF
+ if ! compile_object ""; then
+ hvf='no'
+ else
+ hvf='yes'
+ LDFLAGS="-framework Hypervisor $LDFLAGS"
+ fi
+fi
+
#################################################
# Sparc implicitly links with --relax, which is
# incompatible with -r, so --no-relax should be
LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
elif test "$fortify_source" = "yes" ; then
CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
-elif test "$debug" = "no"; then
- CFLAGS="-O2 $CFLAGS"
+elif test "$debug" = "yes"; then
+ if compile_prog "-Og" ""; then
+ CFLAGS="-Og $CFLAGS"
+ elif compile_prog "-O1" ""; then
+ CFLAGS="-O1 $CFLAGS"
+ fi
+ # Workaround GCC false-positive Wuninitialized bugs with Og or O1:
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
+ if cc_has_warning_flag "-Wno-maybe-uninitialized"; then
+ CFLAGS="-Wno-maybe-uninitialized $CFLAGS"
+ fi
+else
+ CFLAGS="-O2 $CFLAGS"
fi
##########################################
echo "Install blobs $blobs"
echo "KVM support $kvm"
echo "HAX support $hax"
+echo "HVF support $hvf"
echo "TCG support $tcg"
if test "$tcg" = "yes" ; then
echo "TCG debug enabled $debug_tcg"
echo "TCG interpreter $tcg_interpreter"
fi
+echo "malloc trim support $malloc_trim"
echo "RDMA support $rdma"
echo "fdt support $fdt"
echo "preadv support $preadv"
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
+if test "$gtkabi" = "2.0"; then
+ echo
+ echo "WARNING: Use of GTK 2.0 is deprecated and will be removed in"
+ echo "WARNING: future releases. Please switch to using GTK 3.0"
+fi
+
if test "$supported_cpu" = "no"; then
echo
echo "WARNING: SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!"
fi
fi
+if test "$malloc_trim" = "yes" ; then
+ echo "CONFIG_MALLOC_TRIM=y" >> $config_host_mak
+fi
+
if test "$avx2_opt" = "yes" ; then
echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
fi
target_bigendian="no"
case "$target_name" in
- armeb|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
+ armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
target_bigendian=yes
;;
esac
mttcg="yes"
gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
;;
- aarch64)
+ aarch64|aarch64_be)
+ TARGET_ARCH=aarch64
TARGET_BASE_ARCH=arm
bflt="yes"
mttcg="yes"
if supported_hax_target $target; then
echo "CONFIG_HAX=y" >> $config_target_mak
fi
+if supported_hvf_target $target; then
+ echo "CONFIG_HVF=y" >> $config_target_mak
+fi
if test "$target_bigendian" = "yes" ; then
echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
fi