5 export SANITIZER
=${SANITIZER:-address}
6 flags
="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
7 sanitizer_flags
="-fsanitize=address -fsanitize-address-use-after-scope"
8 coverage_flags
="-fsanitize=fuzzer-no-link"
10 export CC
=${CC:-clang}
11 export CFLAGS
=${CFLAGS:-$flags $sanitizer_flags $coverage_flags}
13 export CXX
=${CXX:-clang++}
14 export CXXFLAGS
=${CXXFLAGS:-$flags $sanitizer_flags $coverage_flags}
16 export OUT
=${OUT:-$(pwd)/out}
19 export LIB_FUZZING_ENGINE
=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
21 # -fsanitize=... isn't compatible with -Wl,-no-undefined
22 # https://github.com/google/sanitizers/issues/380
23 sed -i 's/-Wl,-no-undefined *\\/\\/' src
/lxc
/Makefile.am
25 # AFL++ and hoggfuzz are both incompatible with lto=thin apparently
26 sed -i '/-flto=thin/d' configure.ac
28 # turn off the libutil dependency
29 sed -i 's/^AC_CHECK_LIB(util/#/' configure.ac
39 --disable-capabilities
43 $CC -c -o fuzz-lxc-config-read.o
$CFLAGS -Isrc -Isrc/lxc src
/tests
/fuzz-lxc-config-read.c
44 $CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz-lxc-config-read.o src
/lxc
/.libs
/liblxc.a
-o $OUT/fuzz-lxc-config-read
46 zip -r $OUT/fuzz-lxc-config-read_seed_corpus.
zip doc
/examples