1#!/bin/bash -eu 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./bootstrap 18./configure 19make "-j$(nproc)" 20 21for fuzzer in $SRC/*_fuzzer.c; do 22 fuzzer_basename=$(basename -s .c $fuzzer) 23 24 $CC $CFLAGS \ 25 -I $SRC -Iinclude \ 26 -c $fuzzer -o $fuzzer_basename.o 27 28 $CXX $CXXFLAGS \ 29 -std=c++11 \ 30 $fuzzer_basename.o \ 31 -o $OUT/$fuzzer_basename \ 32 $LIB_FUZZING_ENGINE \ 33 src/.libs/libyaml.a 34 35 cp $SRC/libyaml_seed_corpus.zip "${OUT}/${fuzzer_basename}_seed_corpus.zip" 36 cp $SRC/libyaml_fuzzer.options "${OUT}/${fuzzer_basename}.options" 37done 38 39cp $SRC/yaml.dict $OUT/ 40