[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 001/150] oss-fuzz/build: remove LIB_FUZZING_ENGINE
From: |
Paolo Bonzini |
Subject: |
[PATCH 001/150] oss-fuzz/build: remove LIB_FUZZING_ENGINE |
Date: |
Mon, 17 Aug 2020 16:34:54 +0200 |
Meson build scripts will only include qemu-fuzz-TARGET rules if configured
with --enable-fuzzing, and that takes care of adding -fsanitize=fuzzer.
Therefore we can just specify the configure option and stop modifying
the CFLAGS and CONFIG_FUZZ options in the "make" invocation.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/oss-fuzz/build.sh | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
index a07b3022e8..52430cb620 100755
--- a/scripts/oss-fuzz/build.sh
+++ b/scripts/oss-fuzz/build.sh
@@ -20,7 +20,7 @@
# e.g.
# $CXX $CXXFLAGS -std=c++11 -Iinclude \
# /path/to/name_of_fuzzer.cc -o $OUT/name_of_fuzzer \
-# $LIB_FUZZING_ENGINE /path/to/library.a
+# -fsanitize=fuzzer /path/to/library.a
fatal () {
echo "Error : ${*}, exiting."
@@ -54,10 +54,6 @@ mkdir -p $OSS_FUZZ_BUILD_DIR || fatal "mkdir
$OSS_FUZZ_BUILD_DIR failed"
cd $OSS_FUZZ_BUILD_DIR || fatal "cd $OSS_FUZZ_BUILD_DIR failed"
-if [ -z ${LIB_FUZZING_ENGINE+x} ]; then
- LIB_FUZZING_ENGINE="-fsanitize=fuzzer"
-fi
-
if [ -z ${OUT+x} ]; then
DEST_DIR=$(realpath "./DEST_DIR")
else
@@ -67,14 +63,12 @@ fi
mkdir -p "$DEST_DIR/lib/" # Copy the shared libraries here
# Build once to get the list of dynamic lib paths, and copy them over
-../configure --disable-werror --cc="$CC" --cxx="$CXX" \
+../configure --disable-werror --cc="$CC" --cxx="$CXX" --enable-fuzzing \
--extra-cflags="$EXTRA_CFLAGS" --target-list="i386-softmmu"
-if ! make CONFIG_FUZZ=y CFLAGS="$LIB_FUZZING_ENGINE" "-j$(nproc)" \
- i386-softmmu/fuzz; then
+if ! make "-j$(nproc)" i386-softmmu/fuzz; then
fatal "Build failed. Please specify a compiler with fuzzing support"\
- "using the \$CC and \$CXX environemnt variables, or specify a"\
- "\$LIB_FUZZING_ENGINE compatible with your compiler"\
+ "using the \$CC and \$CXX environemnt variables"\
"\nFor example: CC=clang CXX=clang++ $0"
fi
@@ -87,7 +81,7 @@ rm ./i386-softmmu/qemu-fuzz-i386
../configure --bindir="$DEST_DIR" --datadir="$DEST_DIR/data/" --disable-werror
\
--cc="$CC" --cxx="$CXX" --extra-cflags="$EXTRA_CFLAGS" \
--extra-ldflags="-Wl,-rpath,'\$\$ORIGIN/lib'"
-make CONFIG_FUZZ=y CFLAGS="$LIB_FUZZING_ENGINE" "-j$(nproc)" i386-softmmu/fuzz
+make "-j$(nproc)" i386-softmmu/fuzz
# Copy over the datadir
cp -r ../pc-bios/ "$DEST_DIR/pc-bios"
--
2.26.2
- [PATCH v3 000/150] Meson integration for 5.2, Paolo Bonzini, 2020/08/17
- [PATCH 001/150] oss-fuzz/build: remove LIB_FUZZING_ENGINE,
Paolo Bonzini <=
- [PATCH 002/150] optionrom: simplify Makefile, Paolo Bonzini, 2020/08/17
- [PATCH 003/150] pc-bios/s390-ccw: do not use rules.mak, Paolo Bonzini, 2020/08/17
- [PATCH 004/150] trace: switch position of headers to what Meson requires, Paolo Bonzini, 2020/08/17
- [PATCH 006/150] build-sys hack: ensure target directory is there, Paolo Bonzini, 2020/08/17
- [PATCH 008/150] tests/vm: check for Python YAML parser in the Makefile, Paolo Bonzini, 2020/08/17
- [PATCH 007/150] tests/vm: do not pollute configure with --efi-aarch64, Paolo Bonzini, 2020/08/17
- [PATCH 005/150] meson: rename .inc.c files to .inc, Paolo Bonzini, 2020/08/17
- [PATCH 009/150] tests/docker: add test script for static linux-user builds, Paolo Bonzini, 2020/08/17
- [PATCH 011/150] configure: do not include $(...) variables in config-host.mak, Paolo Bonzini, 2020/08/17
- [PATCH 010/150] nsis: use "make DESTDIR=" instead of "make prefix=", Paolo Bonzini, 2020/08/17