1#!/bin/bash -eux 2# Copyright 2016 Google Inc. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16################################################################################ 17 18cd $SRC/fribidi 19./autogen.sh --disable-docs --enable-static=yes --enable-shared=no --with-pic=yes --prefix=/work/ 20make install 21 22cd $SRC/harfbuzz 23 24# setup 25build=$WORK/build 26 27# # cleanup 28rm -rf $build 29mkdir -p $build 30 31# disable sanitize=vptr for harfbuzz since it compiles without rtti 32CFLAGS="$CFLAGS -fno-sanitize=vptr" \ 33CXXFLAGS="$CXXFLAGS -fno-sanitize=vptr" \ 34meson --default-library=static --wrap-mode=nodownload \ 35 -Dfuzzer_ldflags="$(echo $LIB_FUZZING_ENGINE)" \ 36 --prefix=/work/ --libdir=lib $build \ 37 || (cat build/meson-logs/meson-log.txt && false) 38meson install -C $build 39 40cd $SRC/libass 41 42export PKG_CONFIG_PATH=/work/lib/pkgconfig 43./autogen.sh 44./configure --disable-asm 45make -j$(nproc) 46 47$CXX $CXXFLAGS -std=c++11 -I$SRC/libass -L/work/lib \ 48 $SRC/libass_fuzzer.cc -o $OUT/libass_fuzzer \ 49 $LIB_FUZZING_ENGINE libass/.libs/libass.a \ 50 -Wl,-Bstatic -lfontconfig -lfribidi -lfreetype -lharfbuzz -lz -lpng12 \ 51 -lexpat -Wl,-Bdynamic 52 53cp $SRC/*.dict $SRC/*.options $OUT/ 54