• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -eu
2# Copyright 2019 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
18if [[ $CFLAGS = *sanitize=memory* ]]
19then
20    export CXXFLAGS="$CXXFLAGS -DMSAN"
21fi
22
23if [[ $CFLAGS = *sanitize=address* ]]
24then
25    export CXXFLAGS="$CXXFLAGS -DASAN"
26fi
27
28$CXX $CXXFLAGS -D_GLIBCXX_DEBUG -I $SRC/rapidjson/include fuzzer.cpp $LIB_FUZZING_ENGINE -o $OUT/fuzzer
29cp fuzzer_seed_corpus.zip $OUT
30
31# Disabled because compiliation fails for reasons unknown.
32# Using the exact same compile commands locally does not fail.
33# Try enabling again in the future.
34#cd $SRC/fuzzing-headers/tests
35#$CXX $CXXFLAGS -std=c++2a -D_GLIBCXX_DEBUG -I $SRC/rapidjson/include -I ../include rapidjson.cpp $LIB_FUZZING_ENGINE -o $OUT/fuzzer-extended
36