From 77ef89c1daea8605f5827d967cc5fe72c511a756 Mon Sep 17 00:00:00 2001 From: tsdgeos Date: Fri, 20 Mar 2020 16:45:47 +0100 Subject: [PATCH] Build lcms2 for poppler (#3528) There's quite some code hidden behind #ifdef USE_CMS so better to fuzz that code too --- projects/poppler/Dockerfile | 1 + projects/poppler/build.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/projects/poppler/Dockerfile b/projects/poppler/Dockerfile index dfac4e5c2..672a9472a 100644 --- a/projects/poppler/Dockerfile +++ b/projects/poppler/Dockerfile @@ -19,6 +19,7 @@ MAINTAINER jonathan@titanous.com RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config cmake RUN git clone --depth 1 https://anongit.freedesktop.org/git/poppler/poppler.git RUN git clone --depth 1 git://git.sv.nongnu.org/freetype/freetype2.git +RUN git clone --depth 1 https://github.com/mm2/Little-CMS.git RUN git clone --depth 1 https://github.com/mozilla/pdf.js pdf.js && \ zip -q $SRC/pdf_fuzzer_seed_corpus.zip pdf.js/test/pdfs/*.pdf && \ rm -rf pdf.js diff --git a/projects/poppler/build.sh b/projects/poppler/build.sh index 49478ef23..d6c335520 100755 --- a/projects/poppler/build.sh +++ b/projects/poppler/build.sh @@ -21,6 +21,11 @@ pushd $SRC/freetype2 make -j$(nproc) make install +pushd $SRC/Little-CMS +./configure --prefix="$WORK" --disable-shared PKG_CONFIG_PATH="$WORK/lib/pkgconfig" +make -j$(nproc) +make install + mkdir -p $WORK/poppler pushd $WORK/poppler cmake $SRC/poppler \ @@ -29,7 +34,6 @@ cmake $SRC/poppler \ -DFONT_CONFIGURATION=generic \ -DENABLE_DCTDECODER=none \ -DENABLE_LIBOPENJPEG=none \ - -DENABLE_CMS=none \ -DENABLE_LIBPNG=OFF \ -DENABLE_ZLIB=OFF \ -DENABLE_LIBTIFF=OFF \ @@ -40,15 +44,14 @@ cmake $SRC/poppler \ -DENABLE_UTILS=OFF \ -DWITH_Cairo=OFF \ -DWITH_NSS3=OFF \ - -DFREETYPE_INCLUDE_DIRS=$WORK/include/freetype2 \ - -DFREETYPE_LIBRARY=$WORK/lib + -DCMAKE_INSTALL_PREFIX=$WORK make -j$(nproc) poppler poppler-cpp fuzz_target=pdf_fuzzer $CXX $CXXFLAGS -std=c++11 -I$SRC/poppler/cpp \ $SRC/fuzz/pdf_fuzzer.cc -o $OUT/$fuzz_target \ - $LIB_FUZZING_ENGINE $WORK/poppler/cpp/libpoppler-cpp.a $WORK/poppler/libpoppler.a $WORK/lib/libfreetype.a + $LIB_FUZZING_ENGINE $WORK/poppler/cpp/libpoppler-cpp.a $WORK/poppler/libpoppler.a $WORK/lib/libfreetype.a $WORK/lib/libfreetype.a $WORK/lib/liblcms2.a mv $SRC/{*.zip,*.dict} $OUT