From b52fb8a91d325c533c7dd29d48f7c11b7dea00ee Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 28 Nov 2019 14:18:38 +0100 Subject: [PATCH] contrib/oss-fuzz/build.sh: other attempt at fixing build failure --- contrib/oss-fuzz/build.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/contrib/oss-fuzz/build.sh b/contrib/oss-fuzz/build.sh index f97bb55b..b56a2c82 100755 --- a/contrib/oss-fuzz/build.sh +++ b/contrib/oss-fuzz/build.sh @@ -51,8 +51,7 @@ mv "$SRC"/jbigkit/libjbig/*.h "$WORK/include/" popd if [ "$ARCHITECTURE" = "i386" ]; then - dpkg --add-architecture i386 - apt-get install -y liblzma-dev:i386 + # Nothing else apt-get install -y liblzma-dev fi @@ -61,10 +60,17 @@ cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DBUILD_SHARED_LIBS=off make -j$(nproc) make install -$CXX $CXXFLAGS -std=c++11 -I$WORK/include \ - $SRC/libtiff/contrib/oss-fuzz/tiff_read_rgba_fuzzer.cc -o $OUT/tiff_read_rgba_fuzzer \ - $LIB_FUZZING_ENGINE $WORK/lib/libtiffxx.a $WORK/lib/libtiff.a $WORK/lib/libz.a $WORK/lib/libjpeg.a \ - $WORK/lib/libjbig.a $WORK/lib/libjbig85.a -Wl,-Bstatic -llzma -Wl,-Bdynamic +if [ "$ARCHITECTURE" = "i386" ]; then + $CXX $CXXFLAGS -std=c++11 -I$WORK/include \ + $SRC/libtiff/contrib/oss-fuzz/tiff_read_rgba_fuzzer.cc -o $OUT/tiff_read_rgba_fuzzer \ + $LIB_FUZZING_ENGINE $WORK/lib/libtiffxx.a $WORK/lib/libtiff.a $WORK/lib/libz.a $WORK/lib/libjpeg.a \ + $WORK/lib/libjbig.a $WORK/lib/libjbig85.a +else + $CXX $CXXFLAGS -std=c++11 -I$WORK/include \ + $SRC/libtiff/contrib/oss-fuzz/tiff_read_rgba_fuzzer.cc -o $OUT/tiff_read_rgba_fuzzer \ + $LIB_FUZZING_ENGINE $WORK/lib/libtiffxx.a $WORK/lib/libtiff.a $WORK/lib/libz.a $WORK/lib/libjpeg.a \ + $WORK/lib/libjbig.a $WORK/lib/libjbig85.a -Wl,-Bstatic -llzma -Wl,-Bdynamic +fi mkdir afl_testcases (cd afl_testcases; tar xf "$SRC/afl_testcases.tgz")