1#!/bin/bash -eu 2# Copyright 2018 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 18# supp_size is unused in harfbuzz so we will avoid it being unused. 19sed -i 's/supp_size;/supp_size;(void)(supp_size);/g' ./thirdparty/harfbuzz/src/hb-subset-cff1.cc 20 21LDFLAGS="$CXXFLAGS" make -j$(nproc) HAVE_GLUT=no build=debug OUT=$WORK 22fuzz_target=pdf_fuzzer 23 24$CXX $CXXFLAGS -std=c++11 -Iinclude \ 25 $SRC/pdf_fuzzer.cc -o $OUT/$fuzz_target \ 26 $LIB_FUZZING_ENGINE $WORK/libmupdf.a $WORK/libmupdf-third.a 27 28mv $SRC/{*.zip,*.dict,*.options} $OUT 29 30if [ ! -f "${OUT}/${fuzz_target}_seed_corpus.zip" ]; then 31 echo "missing seed corpus" 32 exit 1 33fi 34 35if [ ! -f "${OUT}/${fuzz_target}.dict" ]; then 36 echo "missing dictionary" 37 exit 1 38fi 39 40if [ ! -f "${OUT}/${fuzz_target}.options" ]; then 41 echo "missing options" 42 exit 1 43fi 44