diff --git a/projects/libass/Dockerfile b/projects/libass/Dockerfile index 5253bb944..b0758cef1 100644 --- a/projects/libass/Dockerfile +++ b/projects/libass/Dockerfile @@ -15,9 +15,11 @@ ################################################################################ FROM gcr.io/oss-fuzz-base/base-builder -RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config libfreetype6-dev libfontconfig1-dev +RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config libfreetype6-dev libfontconfig1-dev python3-pip && \ + pip3 install meson==0.53.0 ninja RUN git clone --depth 1 https://github.com/libass/libass.git RUN git clone --depth 1 https://github.com/behdad/fribidi.git +RUN git clone --depth 1 https://github.com/harfbuzz/harfbuzz.git COPY build.sh libass_fuzzer.cc *.dict *.options $SRC/ diff --git a/projects/libass/build.sh b/projects/libass/build.sh index cb4870180..44006e37f 100755 --- a/projects/libass/build.sh +++ b/projects/libass/build.sh @@ -19,6 +19,24 @@ cd $SRC/fribidi ./autogen.sh --disable-docs --enable-static=yes --enable-shared=no --with-pic=yes --prefix=/work/ make install +cd $SRC/harfbuzz + +# setup +build=$WORK/build + +# # cleanup +rm -rf $build +mkdir -p $build + +# disable sanitize=vptr for harfbuzz since it compiles without rtti +CFLAGS="$CFLAGS -fno-sanitize=vptr" \ +CXXFLAGS="$CXXFLAGS -fno-sanitize=vptr" \ +meson --default-library=static --wrap-mode=nodownload \ + -Dfuzzer_ldflags="$(echo $LIB_FUZZING_ENGINE)" \ + --prefix=/work/ --libdir=lib $build \ + || (cat build/meson-logs/meson-log.txt && false) +meson install -C $build + cd $SRC/libass export PKG_CONFIG_PATH=/work/lib/pkgconfig @@ -29,7 +47,7 @@ make -j$(nproc) $CXX $CXXFLAGS -std=c++11 -I$SRC/libass -L/work/lib \ $SRC/libass_fuzzer.cc -o $OUT/libass_fuzzer \ $LIB_FUZZING_ENGINE libass/.libs/libass.a \ - -Wl,-Bstatic -lfontconfig -lfribidi -lfreetype -lz -lpng12 \ + -Wl,-Bstatic -lfontconfig -lfribidi -lfreetype -lharfbuzz -lz -lpng12 \ -lexpat -Wl,-Bdynamic cp $SRC/*.dict $SRC/*.options $OUT/