audio_drv_list=""
block_drv_rw_whitelist=""
block_drv_ro_whitelist=""
+block_drv_whitelist_tools="no"
host_cc="cc"
audio_win_int=""
libs_qga=""
virtfs="auto"
libudev="auto"
mpath="auto"
-vnc="enabled"
+vnc="auto"
sparse="auto"
vde="$default_feature"
vnc_sasl="auto"
vnc_jpeg="auto"
vnc_png="auto"
xkbcommon="auto"
-xen="$default_feature"
+xen=${default_feature:+disabled}
xen_ctrl_version="$default_feature"
xen_pci_passthrough="auto"
linux_aio="$default_feature"
xfs="$default_feature"
tcg="enabled"
membarrier="$default_feature"
+vhost_kernel="$default_feature"
vhost_net="$default_feature"
vhost_crypto="$default_feature"
vhost_scsi="$default_feature"
vhost_user="no"
vhost_user_blk_server="auto"
vhost_user_fs="$default_feature"
+vhost_vdpa="$default_feature"
bpf="auto"
kvm="auto"
hax="auto"
;;
FreeBSD)
bsd="yes"
+ bsd_user="yes"
make="${MAKE-gmake}"
audio_drv_list="oss try-sdl"
audio_possible_drivers="oss sdl pa"
;;
Haiku)
haiku="yes"
- QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE $QEMU_CFLAGS"
+ pie="no"
+ QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS"
;;
Linux)
audio_drv_list="try-pa oss"
;;
esac
-if [ "$bsd" = "yes" ] ; then
- if [ "$darwin" != "yes" ] ; then
- bsd_user="yes"
- fi
-fi
-
: ${make=${MAKE-make}}
# We prefer python 3.x. A bare 'python' is traditionally
;;
--block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g')
;;
+ --enable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="yes"
+ ;;
+ --disable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="no"
+ ;;
--enable-debug-tcg) debug_tcg="yes"
;;
--disable-debug-tcg) debug_tcg="no"
--block-drv-whitelist=L Same as --block-drv-rw-whitelist=L
--block-drv-rw-whitelist=L
set block driver read-write whitelist
- (affects only QEMU, not qemu-img)
+ (by default affects only QEMU, not tools like qemu-img)
--block-drv-ro-whitelist=L
set block driver read-only whitelist
- (affects only QEMU, not qemu-img)
+ (by default affects only QEMU, not tools like qemu-img)
+ --enable-block-drv-whitelist-in-tools
+ use block whitelist also in tools instead of only QEMU
--enable-trace-backends=B Set trace backend
Available backends: $trace_backend_list
--with-trace-file=NAME Full PATH,NAME of file to store traces
glib_modules=gthread-2.0
if test "$modules" = yes; then
glib_modules="$glib_modules gmodule-export-2.0"
-fi
-if test "$plugins" = "yes"; then
- glib_modules="$glib_modules gmodule-2.0"
+elif test "$plugins" = "yes"; then
+ glib_modules="$glib_modules gmodule-no-export-2.0"
fi
for i in $glib_modules; do
"build target"
fi
-# Silence clang 3.5.0 warnings about glib attribute __alloc_size__ usage
-cat > $TMPC << EOF
-#include <glib.h>
-int main(void) { return 0; }
-EOF
-if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then
- if cc_has_warning_flag "-Wno-unknown-attributes"; then
- glib_cflags="-Wno-unknown-attributes $glib_cflags"
- CONFIGURE_CFLAGS="-Wno-unknown-attributes $CONFIGURE_CFLAGS"
- fi
-fi
-
# Silence clang warnings triggered by glib < 2.57.2
cat > $TMPC << EOF
#include <glib.h>
##########################################
# opengl probe (for sdl2, gtk)
-gbm="no"
-if $pkg_config gbm; then
- gbm_cflags="$($pkg_config --cflags gbm)"
- gbm_libs="$($pkg_config --libs gbm)"
- gbm="yes"
-fi
-
if test "$opengl" != "no" ; then
epoxy=no
if $pkg_config epoxy; then
}
int main(int argc, char *argv[]) { return bar(argv[0]); }
EOF
- if compile_object "" ; then
+ if compile_object "-Werror" ; then
avx2_opt="yes"
else
avx2_opt="no"
return bar(argv[0]);
}
EOF
- if ! compile_object "" ; then
+ if ! compile_object "-Werror" ; then
avx512f_opt="no"
fi
else
int main(void)
{
uint64_t x = 0, y = 0;
-#ifdef __ATOMIC_RELAXED
y = __atomic_load_n(&x, __ATOMIC_RELAXED);
__atomic_store_n(&x, y, __ATOMIC_RELAXED);
__atomic_compare_exchange_n(&x, &y, x, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
__atomic_exchange_n(&x, y, __ATOMIC_RELAXED);
__atomic_fetch_add(&x, y, __ATOMIC_RELAXED);
-#else
- typedef char is_host64[sizeof(void *) >= sizeof(uint64_t) ? 1 : -1];
- __sync_lock_test_and_set(&x, y);
- __sync_val_compare_and_swap(&x, y, 0);
- __sync_fetch_and_add(&x, y);
-#endif
return 0;
}
EOF
##########################################
# checks for fuzzer
-if test "$fuzzing" = "yes" && test -z "${LIB_FUZZING_ENGINE+xxx}"; then
+if test "$fuzzing" = "yes" ; then
write_c_fuzzer_skeleton
- if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then
- have_fuzzer=yes
- else
- error_exit "Your compiler doesn't support -fsanitize=fuzzer"
- exit 1
+ if test -z "${LIB_FUZZING_ENGINE+xxx}"; then
+ if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then
+ have_fuzzer=yes
+ else
+ error_exit "Your compiler doesn't support -fsanitize=fuzzer"
+ exit 1
+ fi
+ fi
+
+ have_clang_coverage_filter=no
+ echo > $TMPTXT
+ if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer -fsanitize-coverage-allowlist=$TMPTXT" ""; then
+ have_clang_coverage_filter=yes
fi
fi
fi
echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak
echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak
+if test "$block_drv_whitelist_tools" = "yes" ; then
+ echo "CONFIG_BDRV_WHITELIST_TOOLS=y" >> $config_host_mak
+fi
if test "$xfs" = "yes" ; then
echo "CONFIG_XFS=y" >> $config_host_mak
fi
echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
fi
-if test "$gbm" = "yes" ; then
- echo "CONFIG_GBM=y" >> $config_host_mak
- echo "GBM_LIBS=$gbm_libs" >> $config_host_mak
- echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak
-fi
-
-
if test "$avx2_opt" = "yes" ; then
echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
fi
else
FUZZ_EXE_LDFLAGS="$LIB_FUZZING_ENGINE"
fi
+
+ # Specify a filter to only instrument code that is directly related to
+ # virtual-devices.
+ if test "$have_clang_coverage_filter" = "yes" ; then
+ cp "$source_path/scripts/oss-fuzz/instrumentation-filter-template" \
+ instrumentation-filter
+ QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize-coverage-allowlist=instrumentation-filter"
+ fi
fi
if test "$plugins" = "yes" ; then
echo "[properties]" >> $cross
# unroll any custom device configs
- if test -n "$device_archs"; then
- for a in $device_archs; do
- eval "c=\$devices_${a}"
- echo "${a}-softmmu = '$c'" >> $cross
- done
- fi
+ for a in $device_archs; do
+ eval "c=\$devices_${a}"
+ echo "${a}-softmmu = '$c'" >> $cross
+ done
test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
-Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
-Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \
-Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\
- $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
+ $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \
-Dtcg_interpreter=$tcg_interpreter \
$cross_arg \
"$PWD" "$source_path"
if test -n "${deprecated_features}"; then
echo "Warning, deprecated features enabled."
- echo "Please see docs/system/deprecated.rst"
+ echo "Please see docs/about/deprecated.rst"
echo " features: ${deprecated_features}"
fi