[zlib-ng] build fixes and improvements (#7467)

* [zlib-ng] fixed dataflow sanitizer build error. #7464

* [zlib-ng] use cmake instead of configure to build fuzzers.
This commit is contained in:
Nathan Moinvaziri 2022-04-01 00:05:01 -04:00 committed by GitHub
parent 4aeb753191
commit 1556fb10d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 13 deletions

View File

@ -15,19 +15,26 @@
#
################################################################################
export LDSHARED=lld
export LDFLAGS="$CFLAGS -stdlib=libc++"
./configure
sed -i 's/$(CC) $(LDFLAGS)/$(CXX) $(LDFLAGS)/g' Makefile
make -j$(nproc) clean
make -j$(nproc) all
make -j$(nproc) check
: ${LD:="${CXX}"}
: ${LDFLAGS:="${CXXFLAGS}"} # to make sure we link against 32-bit libraries
# Package seed corpus
zip $OUT/seed_corpus.zip *.*
for f in $(find . -name '*_fuzzer' -o -name 'fuzzer_*'); do
# Build project
mkdir build && cd build
cmake .. -DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_LINKER="${LD}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_FUZZERS=ON
make clean
make -j $(nproc)
# Copy seed corpus for each fuzzer target
for f in $(find . -type f -name 'fuzzer_*'); do
cp -v $f $OUT
(cd $OUT; ln -s seed_corpus.zip $(basename $f)_seed_corpus.zip)
done

View File

@ -8,12 +8,10 @@ fuzzing_engines:
- libfuzzer
- afl
- honggfuzz
- dataflow
sanitizers:
- address
- memory
- undefined
- dataflow
architectures:
- x86_64
- i386