Commit af14b797 authored by Max Moroz's avatar Max Moroz Committed by Commit Bot

[libFuzzer] Suppress -Wunused-result error caused by _FORTIFY_SOURCE config.

Bug: 932188
Change-Id: Ifa2342a2620a6a63beb00dda306784062271d4e6
Reviewed-on: https://chromium-review.googlesource.com/c/1474992Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarJonathan Metzman <metzman@chromium.org>
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632745}
parent 4798d085
...@@ -4,23 +4,35 @@ ...@@ -4,23 +4,35 @@
import("///build/config/sanitizers/sanitizers.gni") import("///build/config/sanitizers/sanitizers.gni")
config("ignore_unused_result_warning") {
if (is_clang) {
cflags = [
# See crbug.com/932188, libFuzzer does not check the result of write()
# when it does raw printing.
"-Wno-unused-result",
]
}
}
# Engine should be compiled without coverage (infinite loop in trace_cmp). # Engine should be compiled without coverage (infinite loop in trace_cmp).
fuzzing_engine_remove_configs = [ fuzzing_engine_remove_configs = [
"//build/config/coverage:default_coverage", "//build/config/coverage:default_coverage",
"//build/config/sanitizers:default_sanitizer_flags", "//build/config/sanitizers:default_sanitizer_flags",
] ]
# Add any sanitizer flags back. In MSAN builds, instrumenting libfuzzer with # 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 # 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 # 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 # 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 # ASAN from libfuzzer and with ASAN in other TUs. The linker might merge
# instrumented template instantiations with non-instrumented ones (which could # instrumented template instantiations with non-instrumented ones (which could
# have a different ABI) in the final binary, which is problematic for TUs # have a different ABI) in the final binary, which is problematic for TUs
# expecting one particular ABI (https://crbug.com/915422). The other sanitizers # expecting one particular ABI (https://crbug.com/915422). The other sanitizers
# are added back for the same reason. # are added back for the same reason.
fuzzing_engine_add_configs = fuzzing_engine_add_configs = [
[ "//build/config/sanitizers:default_sanitizer_flags_but_coverage" ] "//build/config/sanitizers:default_sanitizer_flags_but_coverage",
":ignore_unused_result_warning",
]
source_set("libfuzzer") { source_set("libfuzzer") {
sources = [ sources = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment