mirror of https://github.com/google/oss-fuzz.git
Switch to using afl-clang-fast for afl++. (#5074)
This commit is contained in:
parent
c38c48cb3d
commit
42018eeb1c
|
@ -147,8 +147,6 @@ RUN mkdir $PRECOMPILED_DIR
|
||||||
|
|
||||||
WORKDIR $SRC
|
WORKDIR $SRC
|
||||||
|
|
||||||
RUN git clone -b stable https://github.com/google/AFL.git afl
|
|
||||||
|
|
||||||
RUN git clone -b stable https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \
|
RUN git clone -b stable https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \
|
||||||
cd aflplusplus && \
|
cd aflplusplus && \
|
||||||
git checkout 068bef5eab942df0a133c92522f2ab81b28ac636
|
git checkout 068bef5eab942df0a133c92522f2ab81b28ac636
|
||||||
|
|
|
@ -15,20 +15,6 @@
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
echo "Compiling afl driver to $LIB_FUZZING_ENGINE"
|
|
||||||
|
|
||||||
# afl needs its special coverage flags
|
|
||||||
export COVERAGE_FLAGS="-fsanitize-coverage=trace-pc-guard"
|
|
||||||
|
|
||||||
mkdir -p $WORK/afl
|
|
||||||
pushd $WORK/afl > /dev/null
|
|
||||||
# Add -Wno-pointer-sign to silence warning (AFL is compiled this way).
|
|
||||||
$CC $CFLAGS -Wno-pointer-sign -c $SRC/afl/llvm_mode/afl-llvm-rt.o.c
|
|
||||||
$CXX $CXXFLAGS -std=c++11 -O2 -c $SRC/libfuzzer/afl/*.cpp -I$SRC/libfuzzer
|
|
||||||
ar r $LIB_FUZZING_ENGINE $WORK/afl/*.o
|
|
||||||
popd > /dev/null
|
|
||||||
rm -rf $WORK/afl
|
|
||||||
|
|
||||||
echo "Compiling afl++"
|
echo "Compiling afl++"
|
||||||
|
|
||||||
# Build and copy afl++ tools necessary for fuzzing.
|
# Build and copy afl++ tools necessary for fuzzing.
|
||||||
|
@ -40,17 +26,21 @@ INITIAL_CXXFLAGS=$CXXFLAGS
|
||||||
INITIAL_CFLAGS=$CFLAGS
|
INITIAL_CFLAGS=$CFLAGS
|
||||||
unset CXXFLAGS
|
unset CXXFLAGS
|
||||||
unset CFLAGS
|
unset CFLAGS
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
AFL_NO_X86=1 PYTHON_INCLUDE=/ make
|
AFL_NO_X86=1 PYTHON_INCLUDE=/ make
|
||||||
make -C utils/aflpp_driver
|
|
||||||
|
|
||||||
CFLAGS=$INITIAL_CFLAGS
|
CFLAGS=$INITIAL_CFLAGS
|
||||||
CXXFLAGS=$INITIAL_CXXFLAGS
|
CXXFLAGS=$INITIAL_CXXFLAGS
|
||||||
|
|
||||||
|
# Build afl++ driver with existing CFLAGS, CXXFLAGS.
|
||||||
|
make -C utils/aflpp_driver
|
||||||
|
cp libAFLDriver.a $LIB_FUZZING_ENGINE
|
||||||
|
|
||||||
# Some important projects include libraries, copy those even when they don't
|
# Some important projects include libraries, copy those even when they don't
|
||||||
# start with "afl-". Use "sort -u" to avoid a warning about duplicates.
|
# start with "afl-". Use "sort -u" to avoid a warning about duplicates.
|
||||||
ls afl-* *.a *.o *.so | sort -u | xargs cp -t $OUT
|
ls afl-* *.a *.o *.so | sort -u | xargs cp -t $OUT
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
|
export CC="$SRC/aflplusplus/afl-clang-fast"
|
||||||
|
export CXX="$SRC/aflplusplus/afl-clang-fast++"
|
||||||
|
|
||||||
echo " done."
|
echo " done."
|
||||||
|
|
Loading…
Reference in New Issue