oss-fuzz/projects/zlib/build.sh

23 lines
604 B
Bash
Raw Normal View History

#!/bin/bash -eu
./configure
make -j$(nproc) clean
make -j$(nproc) all
2018-11-07 18:20:02 +00:00
# Do not make check as there are tests that fail when compiled with MSAN.
# make -j$(nproc) check
$CXX $CXXFLAGS -std=c++11 -I. \
$SRC/zlib_uncompress_fuzzer.cc -o $OUT/zlib_uncompress_fuzzer \
-lFuzzingEngine ./libz.a
2018-11-07 18:20:02 +00:00
zip $OUT/seed_corpus.zip *.*
for f in $(find $SRC -name '*_fuzzer.c'); do
b=$(basename -s .c $f)
$CC $CFLAGS -I. $f -c -o /tmp/$b.o
$CXX $CXXFLAGS -o $OUT/$b /tmp/$b.o -stdlib=libc++ -lFuzzingEngine ./libz.a
rm -f /tmp/$b.o
ln -s $OUT/seed_corpus.zip $OUT/${b}_seed_corpus.zip
done