2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 19:08:59 +00:00

Merge pull request #1214 from jberkenbilt/fuzz-future

Fuzz future
This commit is contained in:
Jay Berkenbilt 2024-06-18 11:35:59 -04:00 committed by GitHub
commit 516d88566d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 11 deletions

View File

@ -8,8 +8,10 @@ sudo apt-get -y install build-essential cmake zlib1g-dev libjpeg-dev
./fuzz/oss-fuzz-build ./fuzz/oss-fuzz-build
ls -l out/qpdf_fuzzer ls -l out/qpdf_fuzzer
ls -l out/ ls -l out/
if ldd out/qpdf_fuzzer | grep -E 'libjpeg|libz|libqpdf'; then for fuzzer in qpdf_fuzzer future_qpdf_fuzzer; do
echo 1>&2 "*** Fuzzers linked dynamically with some dependent libraries." if ldd out/$fuzzer | grep -E 'libjpeg|libz|libqpdf'; then
ldd out/qpdf_fuzzer echo 1>&2 "*** Fuzzers linked dynamically with some dependent libraries."
exit 2 ldd out/$fuzzer
fi exit 2
fi
done

View File

@ -21,9 +21,18 @@ if [[ $GITHUB_FORK != "" ]]; then
fi fi
fi fi
env CMAKE_PREFIX_PATH=$WORK LDFLAGS="-L$WORK/lib -lpthread" \ for future in ON OFF; do
cmake -S . -B build \ rm -rf build
-DOSS_FUZZ=1 -DBUILD_SHARED_LIBS=0 -DCMAKE_BUILD_TYPE=Debug \ env CMAKE_PREFIX_PATH=$WORK LDFLAGS="-L$WORK/lib -lpthread" \
-DUSE_IMPLICIT_CRYPTO=0 -DREQUIRE_CRYPTO_NATIVE=1 cmake -S . -B build \
cmake --build build -j$(nproc) --target fuzzers -DOSS_FUZZ=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug \
cmake --install build --component fuzz -DUSE_IMPLICIT_CRYPTO=OFF -DREQUIRE_CRYPTO_NATIVE=ON \
-DFUTURE=$future
cmake --build build -j$(nproc) --target fuzzers
cmake --install build --component fuzz
if [[ $future == ON ]]; then
pushd $OUT
for i in *; do mv $i future_$i; done
popd
fi
done