Commit 4521b3a7 authored by Max Moroz's avatar Max Moroz Committed by Commit Bot

Disable "pc-table" instrumentation for libFuzzer builds on Mac.

Bug: 926588
Change-Id: Id336e9fa0db4f01eacee252a5cd17e9d967159ed
Reviewed-on: https://chromium-review.googlesource.com/c/1447016Reviewed-by: default avatarJonathan Metzman <metzman@chromium.org>
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#627949}
parent 1abcb153
......@@ -2,12 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build_overrides/build.gni")
import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/clang/clang.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/toolchain.gni")
import("//build_overrides/build.gni")
if (is_ios) {
import("//build/config/ios/ios_sdk.gni")
......@@ -201,6 +201,11 @@ config("default_sanitizer_ldflags") {
if (use_sanitizer_coverage) {
if (use_libfuzzer) {
ldflags += [ "-fsanitize=fuzzer-no-link" ]
if (is_mac) {
# TODO(crbug.com/926588): on macOS, dead code stripping does not work
# well with `pc-table` instrumentation enabled by `fuzzer-no-link`.
ldflags += [ "-fno-sanitize-coverage=pc-table" ]
}
} else {
ldflags += [ "-fsanitize-coverage=$sanitizer_coverage_flags" ]
}
......@@ -399,6 +404,11 @@ config("coverage_flags") {
if (use_libfuzzer) {
cflags += [ "-fsanitize=fuzzer-no-link" ]
if (is_mac) {
# TODO(crbug.com/926588): on macOS, dead code stripping does not work
# well with `pc-table` instrumentation enabled by `fuzzer-no-link`.
cflags += [ "-fno-sanitize-coverage=pc-table" ]
}
} else {
cflags += [
"-fsanitize-coverage=$sanitizer_coverage_flags",
......
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