[gstreamer] several updates + add new "typefind" target (#938)

* gstreamer: build glib ourselves

Allows having full backtraces of leaks amongst other things

* gstreamer: Don't build orc

it's still too problematic

* gstreamer: Add new typefind fuzzing target

Covers just the typefind element, which has a lot of parsing code within
This commit is contained in:
Edward Hervey 2017-11-01 17:06:31 +01:00 committed by Max Moroz
parent c6125d3a4f
commit 398bb0134e
2 changed files with 32 additions and 6 deletions

View File

@ -23,13 +23,14 @@ MAINTAINER bilboed@bilboed.com
RUN sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list" && \
apt-get update && \
apt-get install -y make autoconf automake libtool build-essential \
autopoint pkg-config bison flex gettext libglib2.0-dev libffi-dev liblzma-dev \
libvorbis-dev libtheora-dev libogg-dev git-annex
autopoint pkg-config bison flex gettext libffi-dev liblzma-dev \
libvorbis-dev libtheora-dev libogg-dev zlib1g-dev
ADD https://ftp.gnome.org/pub/gnome/sources/glib/2.54/glib-2.54.2.tar.xz $SRC
# Checkout all development repositories
#RUN for i in orc gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav; do git clone --depth 1 --recursive https://anongit.freedesktop.org/git/gstreamer/$i $i; done
RUN \
git clone --depth 1 --recursive https://anongit.freedesktop.org/git/gstreamer/orc orc && \
git clone --depth 1 --recursive https://anongit.freedesktop.org/git/gstreamer/gstreamer gstreamer && \
git clone --depth 1 --recursive https://anongit.freedesktop.org/git/gstreamer/gst-plugins-base gst-plugins-base && \
git clone --depth 1 --recursive https://anongit.freedesktop.org/git/gstreamer/gst-ci gst-ci

View File

@ -21,12 +21,19 @@ PREFIX=$WORK/prefix
PLUGIN_DIR=$PREFIX/lib/gstreamer-1.0
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
mkdir -p $PREFIX
export PATH=$PREFIX/bin:$PATH
cd $WORK
# Minimize gst-debug level/code
export CFLAGS="$CFLAGS -DGST_LEVEL_MAX=2"
for i in orc gstreamer gst-plugins-base;
tar xvJf $SRC/glib-2.54.2.tar.xz
cd glib-2.54.2
./configure --prefix=$PREFIX --enable-static --disable-shared --disable-libmount --with-pcre=internal && make -j$(nproc) && make install
cd ..
for i in gstreamer gst-plugins-base;
do
mkdir -p $i
cd $i
@ -39,12 +46,12 @@ do
done
#finally build the binary \o/
BUILD_CFLAGS="$CFLAGS `pkg-config --static --cflags glib-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-app-1.0 orc-0.4`"
BUILD_CFLAGS="$CFLAGS `pkg-config --static --cflags glib-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-app-1.0`"
# List of dependencies libraries we grab from pkg-config
# Should also include dependencies of dependencies (ex: libvorbis depends on libogg)
PKG_DEPS="glib-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 orc-0.4 \
PKG_DEPS="glib-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 \
gstreamer-riff-1.0 gstreamer-tag-1.0 gstreamer-app-1.0 zlib \
ogg vorbis vorbisenc theoraenc theoradec theora"
@ -95,3 +102,21 @@ echo ">>>> Installing OGG corpus"
echo
cp $SRC/*_seed_corpus.zip $OUT
echo ">>>> BUILDING typefind.o"
echo
$CC $CFLAGS $BUILD_CFLAGS -c $SRC/gst-ci/fuzzing/typefind.c -o $SRC/gst-ci/fuzzing/typefind.o
echo
echo ">>>> LINKING"
echo
$CXX $CXXFLAGS \
-o $OUT/typefind \
$PREDEPS_LDFLAGS \
$SRC/gst-ci/fuzzing/typefind.o \
$PLUGINS \
$BUILD_LDFLAGS \
$LIB_FUZZING_ENGINE \
-Wl,-Bdynamic