Commit 0cae2225 authored by Joel Klinghed's avatar Joel Klinghed Committed by Commit Bot

Make asan blacklists optional

Default is still on but the use of blacklists for asan can be
disabled by setting asan_use_blacklist to false.

This is useful for distributed compilers such as icecc where
flags as -fsanitize-blacklist= pointing to a local source file
is not yet supported.

Bug: 818190
Change-Id: I828ada1142ef76ecc0f1ccad8bd41390f0cbceea
Reviewed-on: https://chromium-review.googlesource.com/c/946101
Commit-Queue: Joel Klinghed <the_jk@opera.com>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629534}
parent 21b973be
...@@ -300,19 +300,22 @@ config("asan_flags") { ...@@ -300,19 +300,22 @@ config("asan_flags") {
"-asan-globals=0", "-asan-globals=0",
] ]
} }
if (is_win) { if (asan_use_blacklist) {
if (!defined(asan_win_blacklist_path)) { if (is_win) {
asan_win_blacklist_path = if (!defined(asan_win_blacklist_path)) {
rebase_path("//tools/memory/asan/blacklist_win.txt", root_build_dir) asan_win_blacklist_path =
} rebase_path("//tools/memory/asan/blacklist_win.txt",
cflags += [ "-fsanitize-blacklist=$asan_win_blacklist_path" ] root_build_dir)
} else { }
# TODO(rnk): Remove this as discussed in http://crbug.com/427202. cflags += [ "-fsanitize-blacklist=$asan_win_blacklist_path" ]
if (!defined(asan_blacklist_path)) { } else {
asan_blacklist_path = # TODO(rnk): Remove this as discussed in http://crbug.com/427202.
rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) if (!defined(asan_blacklist_path)) {
asan_blacklist_path =
rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir)
}
cflags += [ "-fsanitize-blacklist=$asan_blacklist_path" ]
} }
cflags += [ "-fsanitize-blacklist=$asan_blacklist_path" ]
} }
} }
} }
......
...@@ -109,6 +109,9 @@ declare_args() { ...@@ -109,6 +109,9 @@ declare_args() {
# Default value when unset and use_sanitizer_coverage=true: # Default value when unset and use_sanitizer_coverage=true:
# trace-pc-guard,indirect-calls # trace-pc-guard,indirect-calls
sanitizer_coverage_flags = "" sanitizer_coverage_flags = ""
# Use blacklists from tools/memory/asan when compiling with asan.
asan_use_blacklist = true
} }
# Disable sanitizers for non-default toolchains. # 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