blob: 87914b6c4c9f93d04cbe706e1e9e1204f65b86fd [file] [log] [blame]
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO(sbucur): Verify whether this can be specified directly in Starlark,
# perhaps using a C++ toolchain customization.
# Common flags for Clang.
build:clang --action_env=CC=clang
build:clang --action_env=CXX=clang++
# Common fuzzing flags. To be only used by other configs.
build:_fuzzer_common --config=clang
build:_fuzzer_common --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
# Flags for Clang with ASAN and libfuzzer.
build:asan-libfuzzer --config=_fuzzer_common
build:asan-libfuzzer --linkopt=-fsanitize=fuzzer,address
build:asan-libfuzzer --copt=-fsanitize=fuzzer,address
build:asan-libfuzzer --//fuzzing:cc_engine=//fuzzing/engines:libfuzzer
# Flags for Clang with ASAN and Honggfuzz.
# Reflects the set of options at
# https://github.com/google/honggfuzz/blob/master/hfuzz_cc/hfuzz-cc.c
build:asan-honggfuzz --config=_fuzzer_common
build:asan-honggfuzz --dynamic_mode=off
build:asan-honggfuzz --copt=-mllvm
build:asan-honggfuzz --copt=-inline-threshold=2000
build:asan-honggfuzz --copt=-fno-builtin
build:asan-honggfuzz --copt=-fno-omit-frame-pointer
build:asan-honggfuzz --copt=-D__NO_STRING_INLINES
build:asan-honggfuzz --copt=-fsanitize=address
build:asan-honggfuzz --copt=-fsanitize-coverage=trace-pc-guard,trace-cmp,trace-div,indirect-calls
build:asan-honggfuzz --linkopt=-fsanitize=address
build:asan-honggfuzz --//fuzzing:cc_engine=//fuzzing/engines:honggfuzz
# Flags for Clang with MSAN and libfuzzer.
build:msan-libfuzzer --config=_fuzzer_common
build:msan-libfuzzer --linkopt=-fsanitize=memory,fuzzer
build:msan-libfuzzer --copt=-fsanitize=memory,fuzzer
build:msan-libfuzzer --//fuzzing:cc_engine=//fuzzing/engines:libfuzzer
# Flags for Clang with MSAN and libfuzzer, outputting detailed report.
build:msan-libfuzzer-repro --config=msan-libfuzzer
build:msan-libfuzzer-repro --copt=-fsanitize-memory-track-origins=2