Skip to content

Commit

Permalink
Add a libfuzzer config to the build system. (#11921)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 19, 2022
1 parent ed8332f commit 5626539
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ declare_args() {
# enable undefined behavior sanitizer
is_ubsan = false

# enable libfuzzer
is_libfuzzer = false

# Exit on sanitize error. Generally standard libraries may get errors
# so not stopping on the first error is often useful
is_sanitize_fatal = true
Expand Down Expand Up @@ -374,7 +377,16 @@ config("sanitize_default") {
}
}

config("libfuzzer_fuzzing") {
cflags = [ "-fsanitize=fuzzer" ]
ldflags = cflags
}

config("fuzzing_default") {
configs = []
if (is_libfuzzer) {
configs += [ ":libfuzzer_fuzzing" ]
}
}

declare_args() {
Expand Down

0 comments on commit 5626539

Please sign in to comment.