add more corpora (#508)

* add cdr corpus

* add vsd corpus

* add zmf corpus

* add pmd corpus

* add fh corpus
This commit is contained in:
David Tardon 2017-04-04 17:55:01 +02:00 committed by Abhishek Arya
parent e05bbfd2bc
commit 9bf074e1fd
2 changed files with 85 additions and 6 deletions

View File

@ -18,14 +18,27 @@ FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER dtardon@redhat.com MAINTAINER dtardon@redhat.com
# install build requirements # install build requirements
RUN apt-get update 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 # download fuzzing corpora
ADD https://dev-www.libreoffice.org/corpus/olefuzzer_seed_corpus.zip \ 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/pubfuzzer_seed_corpus.zip \
https://dev-www.libreoffice.org/corpus/zipfuzzer_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/ $SRC/
# clone sources # clone sources
RUN git clone --depth 1 git://git.code.sf.net/p/libwpd/librevenge 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/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 WORKDIR $SRC
COPY build.sh $SRC/ COPY build.sh $SRC/

View File

@ -15,10 +15,23 @@
# #
################################################################################ ################################################################################
# HACK to link with static icu # HACK to force linking with static icu and libxml2
mkdir icu mkdir static
cp -p /usr/lib/*/libicu*.a icu cp -pL \
iculib=$(pwd)/icu /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 pushd librevenge
./autogen.sh ./autogen.sh
@ -32,7 +45,60 @@ pushd libmspub
./autogen.sh ./autogen.sh
./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \ ./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \
ICU_CFLAGS="$(pkg-config --cflags icu-i18n)" \ 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_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_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" REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0"