oss-fuzz/projects/zlib/build.sh

23 lines
604 B
Bash
Executable File

#!/bin/bash -eu
./configure
make -j$(nproc) clean
make -j$(nproc) all
# 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
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