make dlplibs play nicely with MSAN (#886)

* reduce the amount of copypasta

* build zlib internally

* build libpng internally

* build libxml2 internally

* build icu internally

* reduce build deps

* disable tests for more libs

* drop no longer needed envvar override
This commit is contained in:
David Tardon 2017-10-12 18:48:41 +02:00 committed by Oliver Chang
parent c0818e5b62
commit 3374666a61
2 changed files with 70 additions and 95 deletions

View File

@ -19,11 +19,15 @@ MAINTAINER dtardon@redhat.com
# enable source repos
RUN sed -i -e '/^#\s*deb-src.*\smain\s\+restricted/s/^#//' /etc/apt/sources.list
# install build requirements
RUN apt-get update && apt-get build-dep -y \
libmspub librevenge libcdr libvisio libpagemaker libfreehand libwpd \
libwpg libwps libmwaw libe-book libabw libetonyek
RUN apt-get update && apt-get install -y liblzma-dev libpng-dev wget
ADD https://dev-www.libreoffice.org/src/lcms2-2.8.tar.gz $SRC/
RUN apt-get update && \
apt-get install -y wget xz-utils autoconf automake libtool pkg-config \
gperf libboost-dev libglm-dev libmdds-dev
ADD https://dev-www.libreoffice.org/src/lcms2-2.8.tar.gz \
https://dev-www.libreoffice.org/src/zlib-1.2.11.tar.xz \
https://dev-www.libreoffice.org/src/libpng-1.6.34.tar.xz \
https://dev-www.libreoffice.org/src/libxml2-2.9.6.tar.gz \
https://dev-www.libreoffice.org/src/icu4c-59_1-src.tgz \
$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 \

View File

@ -15,22 +15,48 @@
#
################################################################################
# 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 -xJf $SRC/zlib-1.2.11.tar.xz
pushd zlib-1.2.11
./configure --static
make -j$(nproc)
export ZLIB_CFLAGS="-I$(pwd)"
export ZLIB_LIBS="-L$(pwd) -lz"
popd
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
export LCMS2_CFLAGS="-I$(pwd)/include"
export LCMS2_LIBS="-L$(pwd)/src -llcms2"
popd
tar -xJf $SRC/libpng-1.6.34.tar.xz
pushd libpng-1.6.34
./configure --disable-shared --enable-static CPPFLAGS="$ZLIB_CFLAGS" LDFLAGS="$ZLIB_LIBS"
make -j$(nproc)
export LIBPNG_CFLAGS="-I$(pwd)"
export LIBPNG_LIBS="-L$(pwd) -lpng16"
popd
tar -xzf $SRC/libxml2-2.9.6.tar.gz
pushd libxml2-2.9.6
./configure --disable-shared --enable-static --disable-ipv6 --without-python --without-zlib --without-lzma
make -j$(nproc)
export LIBXML_CFLAGS="-I$(pwd)/include"
export LIBXML_LIBS="-L$(pwd) -lxml2"
export XML_CFLAGS="$LIBXML_CFLAGS"
export XML_LIBS="$LIBXML_LIBS"
popd
tar -xzf $SRC/icu4c-59_1-src.tgz
pushd icu/source
./configure --disable-shared --enable-static --with-data-packaging=static --disable-dyload --disable-strict \
--disable-layout --disable-samples --disable-extras --disable-icuio --disable-plugins \
CPPFLAGS=-DU_USE_STRTOD_L=0
make -j$(nproc)
export ICU_CFLAGS="-I$(pwd) -I$(pwd)/i18n -I$(pwd)/common"
export ICU_LIBS="-L$(pwd)/lib -licui18n -licuuc -licudata"
popd
pushd librevenge
@ -39,116 +65,79 @@ pushd librevenge
make -j$(nproc)
rvnginc=$(pwd)/inc
rvnglib=$(pwd)/src/lib
export REVENGE_CFLAGS="-I$(pwd)/inc"
export REVENGE_LIBS="-L$(pwd)/src/lib -lrevenge-0.0"
export REVENGE_STREAM_CFLAGS="-I$(pwd)/inc"
export REVENGE_STREAM_LIBS="-L$(pwd)/src/lib -lrevenge-stream-0.0"
export REVENGE_GENERATORS_CFLAGS="-I$(pwd)/inc"
export REVENGE_GENERATORS_LIBS="-L$(pwd)/src/lib -lrevenge-generators-0.0"
popd
pushd libmspub
./autogen.sh
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers \
ICU_CFLAGS="$(pkg-config --cflags 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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers
make -j$(nproc)
popd
pushd libcdr
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests
make -j$(nproc)
popd
pushd libvisio
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests
make -j$(nproc)
popd
pushd libzmf
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests
make -j$(nproc)
popd
pushd libpagemaker
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers
make -j$(nproc)
popd
pushd libfreehand
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests
make -j$(nproc)
popd
pushd libwpd
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers
make -j$(nproc)
wpdinc=$(pwd)/inc
wpdlib=$(pwd)/src/lib
export WPD_CFLAGS=-I$(pwd)/inc
export WPD_LIBS="-L$(pwd)/src/lib -lwpd-0.10"
popd
pushd libwpg
./autogen.sh
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers \
WPD_CFLAGS=-I$wpdinc WPD_LIBS="-L$wpdlib -lwpd-0.10" \
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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers
make -j$(nproc)
popd
pushd libstaroffice
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers
make -j$(nproc)
popd
pushd libwps
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers
make -j$(nproc)
popd
pushd libmwaw
./autogen.sh
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --disable-zip --enable-fuzzers \
REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0 -lrevenge-stream-0.0" \
REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --disable-zip --enable-fuzzers
make -C src/lib -j$(nproc)
# Link with less parallelism to avoid memory problems on the builders
make -j2
@ -156,45 +145,27 @@ popd
pushd libe-book
./autogen.sh
./configure --without-docs --disable-werror --disable-shared --enable-static --without-tools --enable-fuzzers --without-liblangtag \
LDFLAGS=-L$staticlib \
XML_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"
./configure --without-docs --disable-werror --disable-shared --enable-static \
--without-tools --enable-fuzzers --without-liblangtag --disable-tests
make -j$(nproc)
popd
pushd libabw
./autogen.sh
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers \
LDFLAGS=-L$staticlib \
LIBXML_LIBS="-lxml2 -llzma -licuuc -licudata" \
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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers
make -j$(nproc)
popd
pushd libetonyek
./autogen.sh
./configure --without-docs --disable-werror --disable-shared --enable-static \
--without-tools --enable-fuzzers --with-mdds=0.x --without-liblangtag \
LDFLAGS=-L$staticlib \
XML_LIBS="-lxml2 -llzma -licuuc -licudata" \
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"
--without-tools --enable-fuzzers --with-mdds=0.x --without-liblangtag --disable-tests
make -j$(nproc)
popd
pushd libqxp
./autogen.sh
./configure --without-docs --disable-werror --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"
./configure --without-docs --disable-werror --disable-shared --enable-static --disable-tools --enable-fuzzers --disable-tests
make -j$(nproc)
popd