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/harfbuzz 19 20# setup 21build=$WORK/build 22 23# # cleanup 24rm -rf $build 25mkdir -p $build 26 27# disable sanitize=vptr for harfbuzz since it compiles without rtti 28CFLAGS="$CFLAGS -fno-sanitize=vptr" \ 29CXXFLAGS="$CXXFLAGS -fno-sanitize=vptr" \ 30meson --default-library=static --wrap-mode=nodownload \ 31 -Dfuzzer_ldflags="$(echo $LIB_FUZZING_ENGINE)" \ 32 -Dtests=disabled \ 33 --prefix=/work/ --libdir=lib $build \ 34 || (cat build/meson-logs/meson-log.txt && false) 35meson install -C $build 36 37cd $SRC/libass 38 39export PKG_CONFIG_PATH=/work/lib/pkgconfig 40./autogen.sh 41./configure --disable-asm 42make -j$(nproc) 43 44$CXX $CXXFLAGS -std=c++11 -I$SRC/libass \ 45 $SRC/libass_fuzzer.cc -o $OUT/libass_fuzzer \ 46 $LIB_FUZZING_ENGINE libass/.libs/libass.a \ 47 -Wl,-Bstatic \ 48 $(pkg-config --static --libs fontconfig freetype2 fribidi harfbuzz | sed 's/-lm //g') \ 49 -Wl,-Bdynamic 50 51cp $SRC/*.dict $SRC/*.options $OUT/ 52