The upstream Wuffs project is C, not C++. Having OSS-Fuzz compile Wuffs
as plain C, the way Wuffs' own build system does, should hopefully
lessen OSS-Fuzz build breakages such as issue #1373
Improve builds of AFL package.
Silence trivial known compile warning when building afl-llvm-rt.o.c
Also, don't build afl-fuzz using CFLAGS and CXXFLAGS since we don't
actually want to sanitize it.
This should cause AFL to be built with -O3 -funroll-loops (the defaults) instead of -fsanitize=... -O1 and -ginline-tables-only.
After building AFL fuzzers we will now check if they crash immediately before
uploading a build to CF. That means we can't build broken fuzzers or else
the entire build breaks.
* Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
* Quote the parameter to -name so the shell won't interpret it.
* Add AFL bad build checks (instrumentation, startup crash).
* Fix incorrect seed corpus unpack for afl bad instrumentation, startup crash test
* Match AFL startup crash check with ClusterFuzz
* remove fetching seeds from my corpus, fetch instead from src repo
* conditionally zip up fuzzer seed corpora for any fuzzer passed in
* Simplify build steps
We already know that the fuzzers are being iterated over due to the loop
and globbing. As such, we can use more of the fuzzer name and reduce
repetition. This should allow us to add fuzzers/corpora to the src repo
and no need to change anything about the build script or dockerfile
The Wuffs project handles multiple file formats, such as GIF and ZLIB
decoders. Prior to this commit, the format name and the file extension
were the same (case-insensitive) string: fuzz-testing the GIF format was
seeded with test files matching "*.gif", and "*.gif" was trivially
derived from the "gif_fuzzer.cc" file name.
For the GZIP file format, the conventional file extension is ".gz", not
".gzip". For the JPEG file format, both ".jpeg" and ".jpg" are widely
used. Building the seed corpus for future Wuffs codecs might require
mapping from the file format name to arbitrary file extensions.
Wuffs' fuzz/c/std/seed_corpora.txt file (added in
https://github.com/google/wuffs/commit/b6cc2d5e) provides that mapping.
This commit updates OSS-Fuzz's projects/wuffs/build.sh to use it.