Commit 627b89c9 authored by Matt Morehouse's avatar Matt Morehouse Committed by Commit Bot

Create sanitizer_no_symbols option.

Enabling this option prevents fuzzers/sanitizers from setting the
-gline-tables-only and -gcolumn-info flags, and instead uses the symbol
level defined by symbol_level.

This is particularly useful for reducing binary sizes when building with
use_clang_coverage=true, where stack traces are unneeded and line
numbers for coverage are determined from the coverage mappings.

Bug: 759795
Change-Id: Iae3ea9ede10281c9f29c461ed5d6eec503a661cd
Reviewed-on: https://chromium-review.googlesource.com/887285Reviewed-by: default avatarOliver Chang <ochang@chromium.org>
Reviewed-by: default avatarAbhishek Arya <inferno@chromium.org>
Commit-Queue: Abhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532905}
parent d4dc578e
......@@ -255,16 +255,18 @@ config("common_sanitizer_flags") {
assert(is_clang, "sanitizers only supported with clang")
assert(!is_official_build, "sanitizers not supported in official builds")
if (!sanitizer_keep_symbols) {
cflags += [ "-gline-tables-only" ]
}
if (!sanitizer_no_symbols) {
if (!sanitizer_keep_symbols) {
cflags += [ "-gline-tables-only" ]
}
cflags += [
# Column info in debug data confuses Visual Studio's debugger, so don't
# use this by default. However, clusterfuzz needs it for good attribution
# of reports to CLs, so turn it on there.
"-gcolumn-info",
]
cflags += [
# Column info in debug data confuses Visual Studio's debugger, so don't
# use this by default. However, clusterfuzz needs it for good
# attribution of reports to CLs, so turn it on there.
"-gcolumn-info",
]
}
# Frame pointers are controlled in //build/config/compiler:default_stack_frames
}
......
......@@ -107,6 +107,10 @@ declare_args() {
# necessary, overriding any other symbol level arguments that may be set.
# Setting this to true prevents this.
sanitizer_keep_symbols = false
# Builds fuzzer/sanitizers without symbols. Use with symbol_level=0.
# Useful for reducing binary size when building with use_clang_coverage=true.
sanitizer_no_symbols = false
}
# Disable sanitizers for non-default toolchains.
......
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