2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 02:49:00 +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
ls -l out/qpdf_fuzzer
ls -l out/
if ldd out/qpdf_fuzzer | grep -E 'libjpeg|libz|libqpdf'; then
echo 1>&2 "*** Fuzzers linked dynamically with some dependent libraries."
ldd out/qpdf_fuzzer
exit 2
fi
for fuzzer in qpdf_fuzzer future_qpdf_fuzzer; do
if ldd out/$fuzzer | grep -E 'libjpeg|libz|libqpdf'; then
echo 1>&2 "*** Fuzzers linked dynamically with some dependent libraries."
ldd out/$fuzzer
exit 2
fi
done

View File

@ -21,9 +21,18 @@ if [[ $GITHUB_FORK != "" ]]; then
fi
fi
env CMAKE_PREFIX_PATH=$WORK LDFLAGS="-L$WORK/lib -lpthread" \
cmake -S . -B build \
-DOSS_FUZZ=1 -DBUILD_SHARED_LIBS=0 -DCMAKE_BUILD_TYPE=Debug \
-DUSE_IMPLICIT_CRYPTO=0 -DREQUIRE_CRYPTO_NATIVE=1
cmake --build build -j$(nproc) --target fuzzers
cmake --install build --component fuzz
for future in ON OFF; do
rm -rf build
env CMAKE_PREFIX_PATH=$WORK LDFLAGS="-L$WORK/lib -lpthread" \
cmake -S . -B build \
-DOSS_FUZZ=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug \
-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