[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 02/17] fuzz: Add fuzzer configure options
From: |
Oleinik, Alexander |
Subject: |
[Qemu-devel] [RFC PATCH v2 02/17] fuzz: Add fuzzer configure options |
Date: |
Mon, 5 Aug 2019 07:11:03 +0000 |
This adds sanitizer/fuzzer related cflags and adds tests/ to the include
path. This include change is needed for qos to build, and is normally
located in tests/Makefile.include, but currently the fuzzer builds from
the i386-softmmu target, not anything in tests.
Signed-off-by: Alexander Oleinik <address@hidden>
---
configure | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/configure b/configure
index 714e7fb6a1..69ef1e7c7d 100755
--- a/configure
+++ b/configure
@@ -499,6 +499,7 @@ docker="no"
debug_mutex="no"
libpmem=""
default_devices="yes"
+fuzzing="no"
# cross compilers defaults, can be overridden with --cross-cc-ARCH
cross_cc_aarch64="aarch64-linux-gnu-gcc"
@@ -1543,6 +1544,8 @@ for opt do
;;
--disable-libpmem) libpmem=no
;;
+ --enable-fuzzing) fuzzing=yes
+ ;;
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
@@ -6481,6 +6484,7 @@ echo "docker $docker"
echo "libpmem support $libpmem"
echo "libudev $libudev"
echo "default devices $default_devices"
+echo "fuzzing support $fuzzing"
if test "$supported_cpu" = "no"; then
echo
@@ -7306,6 +7310,17 @@ fi
if test "$sheepdog" = "yes" ; then
echo "CONFIG_SHEEPDOG=y" >> $config_host_mak
fi
+if test "$fuzzing" = "yes" ; then
+ QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize=fuzzer,address
-fprofile-instr-generate"
+ QEMU_CFLAGS="$QEMU_CFLAGS -fprofile-instr-generate -fcoverage-mapping"
+ QEMU_LDFLAGS="$LDFLAGS -fsanitize=fuzzer,address"
+
+ # Add tests/ to include path, since this is done in tests/Makefile.include,
+ # and required for QOS objects to build. This can be removed if/when the
+ # fuzzer is compiled using rules in tests/Makefile.include
+ QEMU_INCLUDES="-iquote \$(SRC_PATH)/tests $QEMU_INCLUDES"
+ echo "CONFIG_FUZZ=y" >> $config_host_mak
+fi
if test "$tcg_interpreter" = "yes"; then
QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
--
2.20.1
- [Qemu-devel] [RFC PATCH v2 00/17] Add virtual device fuzzing support, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 01/17] fuzz: Move initialization from main to qemu_init, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 02/17] fuzz: Add fuzzer configure options,
Oleinik, Alexander <=
- [Qemu-devel] [RFC PATCH v2 03/17] fuzz: Keep memory mapped for fork-based fuzzer, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 04/17] fuzz: Skip modules that were already initialized, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 05/17] fuzz: Add direct receive function for qtest server, Oleinik, Alexander, 2019/08/05