aboutsummaryrefslogtreecommitdiff
path: root/projects/gstreamer
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@gmail.com>2017-11-01 17:06:31 +0100
committerMax Moroz <dor3s1@gmail.com>2017-11-01 09:06:31 -0700
commit398bb0134edca69bf8d44eca299cfaef424ab2c1 (patch)
tree93ded759bfc6c9d145a8a77c1aecd9ec2dad42b3 /projects/gstreamer
parentc6125d3a4f7cf802d433e863157865e404d80130 (diff)
downloadoss-fuzz-398bb0134edca69bf8d44eca299cfaef424ab2c1.tar.gz
[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
Diffstat (limited to 'projects/gstreamer')
-rw-r--r--projects/gstreamer/Dockerfile7
-rwxr-xr-xprojects/gstreamer/build.sh31
2 files changed, 32 insertions, 6 deletions
diff --git a/projects/gstreamer/Dockerfile b/projects/gstreamer/Dockerfile
index da67b6f8a..4df66ca4c 100644
--- a/projects/gstreamer/Dockerfile
+++ b/projects/gstreamer/Dockerfile
@@ -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
diff --git a/projects/gstreamer/build.sh b/projects/gstreamer/build.sh
index dc1a5c4f9..3c0f07d35 100755
--- a/projects/gstreamer/build.sh
+++ b/projects/gstreamer/build.sh
@@ -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