[libass] Build with HarfBuzz (#4562)

This fixes the build that got broken when libass made HarfBuzz
a required dependency. This should also cover more libass code
with the fuzzing.
This commit is contained in:
Oleg Oshmyan 2020-10-24 02:30:28 +02:00 committed by GitHub
parent 3226bd66d2
commit 86eaa2b5d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -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/

View File

@ -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/