diff --git a/projects/dlplibs/Dockerfile b/projects/dlplibs/Dockerfile index 0c128eab1..f9f339d68 100644 --- a/projects/dlplibs/Dockerfile +++ b/projects/dlplibs/Dockerfile @@ -18,14 +18,27 @@ FROM gcr.io/oss-fuzz-base/base-builder MAINTAINER dtardon@redhat.com # install build requirements RUN apt-get update -RUN apt-get build-dep -y libmspub librevenge +RUN apt-get build-dep -y \ + libmspub librevenge libcdr libvisio libpagemaker libfreehand +RUN apt-get install -y liblzma-dev libpng-dev +ADD https://dev-www.libreoffice.org/src/lcms2-2.8.tar.gz $SRC/ # download fuzzing corpora ADD https://dev-www.libreoffice.org/corpus/olefuzzer_seed_corpus.zip \ https://dev-www.libreoffice.org/corpus/pubfuzzer_seed_corpus.zip \ https://dev-www.libreoffice.org/corpus/zipfuzzer_seed_corpus.zip \ + https://dev-www.libreoffice.org/corpus/cdrfuzzer_seed_corpus.zip \ + https://dev-www.libreoffice.org/corpus/vsdfuzzer_seed_corpus.zip \ + https://dev-www.libreoffice.org/corpus/zmffuzzer_seed_corpus.zip \ + https://dev-www.libreoffice.org/corpus/pmdfuzzer_seed_corpus.zip \ + https://dev-www.libreoffice.org/corpus/fhfuzzer_seed_corpus.zip \ $SRC/ # clone sources RUN git clone --depth 1 git://git.code.sf.net/p/libwpd/librevenge RUN git clone --depth 1 git://gerrit.libreoffice.org/libmspub +RUN git clone --depth 1 git://gerrit.libreoffice.org/libcdr +RUN git clone --depth 1 git://gerrit.libreoffice.org/libvisio +RUN git clone --depth 1 git://gerrit.libreoffice.org/libzmf +RUN git clone --depth 1 git://gerrit.libreoffice.org/libpagemaker +RUN git clone --depth 1 git://gerrit.libreoffice.org/libfreehand WORKDIR $SRC COPY build.sh $SRC/ diff --git a/projects/dlplibs/build.sh b/projects/dlplibs/build.sh index 545721118..e668f09bc 100755 --- a/projects/dlplibs/build.sh +++ b/projects/dlplibs/build.sh @@ -15,10 +15,23 @@ # ################################################################################ -# HACK to link with static icu -mkdir icu -cp -p /usr/lib/*/libicu*.a icu -iculib=$(pwd)/icu +# HACK to force linking with static icu and libxml2 +mkdir static +cp -pL \ + /usr/lib/*/libicu*.a \ + /usr/lib/*/libxml2.a \ + /usr/lib/*/liblzma.a \ + /usr/lib/*/libpng*.a \ + static +staticlib=$(pwd)/static + +tar -xzf $SRC/lcms2-2.8.tar.gz +pushd lcms2-2.8 +./configure --disable-shared --enable-static --without-jpeg --without-tiff +make -C src -j$(nproc) +lcmsinc=$(pwd)/include +lcmslib=$(pwd)/src +popd pushd librevenge ./autogen.sh @@ -32,7 +45,60 @@ pushd libmspub ./autogen.sh ./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \ ICU_CFLAGS="$(pkg-config --cflags icu-i18n)" \ - ICU_LIBS="-L$iculib $(pkg-config --libs icu-i18n)" \ + ICU_LIBS="-L$staticlib $(pkg-config --libs icu-i18n)" \ + REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \ + REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \ + REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0" +make -j$(nproc) +popd + +pushd libcdr +./autogen.sh +./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \ + ICU_CFLAGS="$(pkg-config --cflags icu-i18n)" \ + ICU_LIBS="-L$staticlib $(pkg-config --libs icu-i18n)" \ + LCMS2_CFLAGS=-I$lcmsinc LCMS2_LIBS="-L$lcmslib -llcms2" \ + REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \ + REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \ + REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0" +make -j$(nproc) +popd + +pushd libvisio +./autogen.sh +./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \ + LDFLAGS=-L$staticlib \ + LIBXML_LIBS="-lxml2 -llzma" \ + REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \ + REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \ + REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0" +make -j$(nproc) +popd + +pushd libzmf +./autogen.sh +./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \ + LDFLAGS=-L$staticlib \ + REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \ + REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \ + REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0" +make -j$(nproc) +popd + +pushd libpagemaker +./autogen.sh +./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \ + REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \ + REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \ + REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0" +make -j$(nproc) +popd + +pushd libfreehand +./autogen.sh +./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \ + LDFLAGS=-L$staticlib \ + LCMS2_CFLAGS=-I$lcmsinc LCMS2_LIBS="-L$lcmslib -llcms2" \ REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \ REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \ REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0"