libs_qga=""
debug_info="yes"
stack_protector=""
+safe_stack=""
use_containers="yes"
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
fuzzing="no"
rng_none="no"
secret_keyring=""
+libdaxctl=""
supported_cpu="no"
supported_os="no"
;;
--disable-stack-protector) stack_protector="no"
;;
+ --enable-safe-stack) safe_stack="yes"
+ ;;
+ --disable-safe-stack) safe_stack="no"
+ ;;
--disable-curses) curses="no"
;;
--enable-curses) curses="yes"
;;
--enable-vhost-user) vhost_user="yes"
;;
+ --disable-vhost-vdpa) vhost_vdpa="no"
+ ;;
+ --enable-vhost-vdpa) vhost_vdpa="yes"
+ ;;
--disable-vhost-kernel) vhost_kernel="no"
;;
--enable-vhost-kernel) vhost_kernel="yes"
;;
--disable-keyring) secret_keyring="no"
;;
+ --enable-libdaxctl) libdaxctl=yes
+ ;;
+ --disable-libdaxctl) libdaxctl=no
+ ;;
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
debug-tcg TCG debugging (default is disabled)
debug-info debugging information
sparse sparse checker
+ safe-stack SafeStack Stack Smash Protection. Depends on
+ clang/llvm >= 3.7 and requires coroutine backend ucontext.
gnutls GNUTLS cryptography support
nettle nettle cryptography support
vhost-crypto vhost-user-crypto backend support
vhost-kernel vhost kernel backend support
vhost-user vhost-user backend support
+ vhost-vdpa vhost-vdpa kernel backend support
spice spice
rbd rados block device (rbd)
libiscsi iscsi support
libpmem libpmem support
xkbcommon xkbcommon support
rng-none dummy RNG, avoid using /dev/(u)random and getrandom()
+ libdaxctl libdaxctl support
NOTE: The object files are built at the place where configure is launched
EOF
if test "$vhost_user" = "yes" && test "$mingw32" = "yes"; then
error_exit "vhost-user isn't available on win32"
fi
+test "$vhost_vdpa" = "" && vhost_vdpa=$linux
+if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then
+ error_exit "vhost-vdpa is only available on Linux"
+fi
test "$vhost_kernel" = "" && vhost_kernel=$linux
if test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then
error_exit "vhost-kernel is only available on Linux"
if test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then
error_exit "--enable-vhost-user-fs requires --enable-vhost-user"
fi
+#vhost-vdpa backends
+test "$vhost_net_vdpa" = "" && vhost_net_vdpa=$vhost_vdpa
+if test "$vhost_net_vdpa" = "yes" && test "$vhost_vdpa" = "no"; then
+ error_exit "--enable-vhost-net-vdpa requires --enable-vhost-vdpa"
+fi
# OR the vhost-kernel and vhost-user values for simplicity
if test "$vhost_net" = ""; then
have_ifaddrs_h=no
fi
+#########################################
+# libdrm check
+have_drm_h=no
+if check_include "libdrm/drm.h" ; then
+ have_drm_h=yes
+fi
+
##########################################
# VTE probe
int main(void) { return openpty(0, 0, 0, 0, 0); }
EOF
-if ! compile_prog "" "" ; then
+have_openpty="no"
+if compile_prog "" "" ; then
+ have_openpty="yes"
+else
if compile_prog "" "-lutil" ; then
libs_softmmu="-lutil $libs_softmmu"
libs_tools="-lutil $libs_tools"
+ have_openpty="yes"
fi
fi
fi
fi
+##################################################
+# SafeStack
+
+
+if test "$safe_stack" = "yes"; then
+cat > $TMPC << EOF
+int main(int argc, char *argv[])
+{
+#if ! __has_feature(safe_stack)
+#error SafeStack Disabled
+#endif
+ return 0;
+}
+EOF
+ flag="-fsanitize=safe-stack"
+ # Check that safe-stack is supported and enabled.
+ if compile_prog "-Werror $flag" "$flag"; then
+ # Flag needed both at compilation and at linking
+ QEMU_CFLAGS="$QEMU_CFLAGS $flag"
+ QEMU_LDFLAGS="$QEMU_LDFLAGS $flag"
+ else
+ error_exit "SafeStack not supported by your compiler"
+ fi
+ if test "$coroutine" != "ucontext"; then
+ error_exit "SafeStack is only supported by the coroutine backend ucontext"
+ fi
+else
+cat > $TMPC << EOF
+int main(int argc, char *argv[])
+{
+#if defined(__has_feature)
+#if __has_feature(safe_stack)
+#error SafeStack Enabled
+#endif
+#endif
+ return 0;
+}
+EOF
+if test "$safe_stack" = "no"; then
+ # Make sure that safe-stack is disabled
+ if ! compile_prog "-Werror" ""; then
+ # SafeStack was already enabled, try to explicitly remove the feature
+ flag="-fno-sanitize=safe-stack"
+ if ! compile_prog "-Werror $flag" "$flag"; then
+ error_exit "Configure cannot disable SafeStack"
+ fi
+ QEMU_CFLAGS="$QEMU_CFLAGS $flag"
+ QEMU_LDFLAGS="$QEMU_LDFLAGS $flag"
+ fi
+else # "$safe_stack" = ""
+ # Set safe_stack to yes or no based on pre-existing flags
+ if compile_prog "-Werror" ""; then
+ safe_stack="no"
+ else
+ safe_stack="yes"
+ if test "$coroutine" != "ucontext"; then
+ error_exit "SafeStack is only supported by the coroutine backend ucontext"
+ fi
+ fi
+fi
+fi
##########################################
# check if we have open_by_handle_at
fi
fi
+##########################################
+# check for libdaxctl
+
+if test "$libdaxctl" != "no"; then
+ if $pkg_config --atleast-version=57 "libdaxctl"; then
+ libdaxctl="yes"
+ libdaxctl_libs=$($pkg_config --libs libdaxctl)
+ libdaxctl_cflags=$($pkg_config --cflags libdaxctl)
+ libs_softmmu="$libs_softmmu $libdaxctl_libs"
+ QEMU_CFLAGS="$QEMU_CFLAGS $libdaxctl_cflags"
+ else
+ if test "$libdaxctl" = "yes" ; then
+ feature_not_found "libdaxctl" "Install libdaxctl"
+ fi
+ libdaxctl="no"
+ fi
+fi
+
##########################################
# check for slirp
echo "strip binaries $strip_opt"
echo "profiler $profiler"
echo "static build $static"
+echo "safe stack $safe_stack"
if test "$darwin" = "yes" ; then
echo "Cocoa support $cocoa"
fi
echo "vhost-vsock support $vhost_vsock"
echo "vhost-user support $vhost_user"
echo "vhost-user-fs support $vhost_user_fs"
+echo "vhost-vdpa support $vhost_vdpa"
echo "Trace backends $trace_backends"
if have_backend "simple"; then
echo "Trace output file $trace_file-<pid>"
echo "sheepdog support $sheepdog"
echo "capstone $capstone"
echo "libpmem support $libpmem"
+echo "libdaxctl support $libdaxctl"
echo "libudev $libudev"
echo "default devices $default_devices"
echo "plugin support $plugins"
if test "$have_ifaddrs_h" = "yes" ; then
echo "HAVE_IFADDRS_H=y" >> $config_host_mak
fi
+if test "$have_drm_h" = "yes" ; then
+ echo "HAVE_DRM_H=y" >> $config_host_mak
+fi
if test "$have_broken_size_max" = "yes" ; then
echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak
fi
+if test "$have_openpty" = "yes" ; then
+ echo "HAVE_OPENPTY=y" >> $config_host_mak
+fi
# Work around a system header bug with some kernel/XFS header
# versions where they both try to define 'struct fsxattr':
if test "$vhost_net_user" = "yes" ; then
echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak
fi
+if test "$vhost_net_vdpa" = "yes" ; then
+ echo "CONFIG_VHOST_NET_VDPA=y" >> $config_host_mak
+fi
if test "$vhost_crypto" = "yes" ; then
echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak
fi
if test "$vhost_user" = "yes" ; then
echo "CONFIG_VHOST_USER=y" >> $config_host_mak
fi
+if test "$vhost_vdpa" = "yes" ; then
+ echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak
+fi
if test "$vhost_user_fs" = "yes" ; then
echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
fi
echo "CONFIG_LIBPMEM=y" >> $config_host_mak
fi
+if test "$libdaxctl" = "yes" ; then
+ echo "CONFIG_LIBDAXCTL=y" >> $config_host_mak
+fi
+
if test "$bochs" = "yes" ; then
echo "CONFIG_BOCHS=y" >> $config_host_mak
fi
echo "export CCACHE_CPP2=y" >> $config_host_mak
fi
+if test "$safe_stack" = "yes"; then
+ echo "CONFIG_SAFESTACK=y" >> $config_host_mak
+fi
+
# If we're using a separate build tree, set it up now.
# DIRS are directories which we simply mkdir in the build tree;
# LINKS are things to symlink back into the source tree
DIRS="$DIRS tests/qtest tests/qemu-iotests tests/vm tests/fp tests/qgraph"
DIRS="$DIRS docs docs/interop fsdev scsi"
DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
-DIRS="$DIRS roms/seabios roms/vgabios"
+DIRS="$DIRS roms/seabios"
LINKS="Makefile"
LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
LINKS="$LINKS tests/tcg/Makefile.target tests/fp/Makefile"
LINKS="$LINKS tests/plugin/Makefile"
LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
-LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile"
+LINKS="$LINKS roms/seabios/Makefile"
LINKS="$LINKS pc-bios/qemu-icon.bmp"
LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
LINKS="$LINKS tests/acceptance tests/data"
$source_path/tests/tcg/configure.sh)
# temporary config to build submodules
-for rom in seabios vgabios ; do
+for rom in seabios; do
config_mak=roms/$rom/config.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak