1#!/bin/bash -eu 2# 3# Copyright 2016 Google Inc. 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16# 17################################################################################ 18 19./autogen.sh 20./configure --with-http=no 21make -j$(nproc) clean 22make -j$(nproc) all 23 24seed_corpus_temp_file="$OUT/xml_seed_corpus.zip" 25zip -r $seed_corpus_temp_file $SRC/libxml2/test 26 27for fuzzer in libxml2_xml_read_memory_fuzzer libxml2_xml_reader_for_file_fuzzer; do 28 $CXX $CXXFLAGS -std=c++11 -Iinclude/ \ 29 $SRC/$fuzzer.cc -o $OUT/$fuzzer \ 30 $LIB_FUZZING_ENGINE .libs/libxml2.a 31 32 cp $SRC/*.dict $OUT/$fuzzer.dict 33 cp $seed_corpus_temp_file $OUT/${fuzzer}_seed_corpus.zip 34done 35