blob: 0bc238c7bdf36fe090c4c96c33e5730956ceffb2 [file] [log] [blame]
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
config("ignore_unused_result_warning") {
if (is_clang) {
cflags = [
# See, libFuzzer does not check the result of write()
# when it does raw printing.
# Engine should be compiled without coverage (infinite loop in trace_cmp).
fuzzing_engine_remove_configs = [
# Add any sanitizer flags back. In MSAN builds, instrumenting libfuzzer with
# MSAN is necessary since all parts of the binary need to be instrumented for it
# to work. ASAN builds are more subtle: libfuzzer depends on features from the
# C++ STL. If it were not instrumented, templates would be insantiated without
# ASAN from libfuzzer and with ASAN in other TUs. The linker might merge
# instrumented template instantiations with non-instrumented ones (which could
# have a different ABI) in the final binary, which is problematic for TUs
# expecting one particular ABI ( The other sanitizers
# are added back for the same reason.
fuzzing_engine_add_configs = [
source_set("libfuzzer") {
sources = [
configs -= fuzzing_engine_remove_configs
configs += fuzzing_engine_add_configs
if (use_afl) {
source_set("afl_driver") {
sources = [
configs -= fuzzing_engine_remove_configs
configs += fuzzing_engine_add_configs