Wire up memory sanitizer. (#321)

This commit is contained in:
Chinmay Garde 2019-10-04 16:03:45 -07:00 committed by GitHub
parent 41b6918f1c
commit eb6a23609d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -280,6 +280,10 @@ if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) {
is_clang = true
}
if (is_msan && !is_linux) {
assert(false, "Memory sanitizer is only available on Linux.")
}
# =============================================================================
# TARGET DEFAULTS
# =============================================================================

View File

@ -127,13 +127,8 @@ config("compiler") {
ldflags += [ "-fsanitize=thread" ]
}
if (is_msan) {
msan_blacklist_path =
rebase_path("//tools/msan/blacklist.txt", root_build_dir)
cflags += [
"-fsanitize=memory",
"-fsanitize-memory-track-origins=$msan_track_origins",
"-fsanitize-blacklist=$msan_blacklist_path",
]
cflags += [ "-fsanitize=memory" ]
ldflags += [ "-fsanitize=memory" ]
}
if (use_custom_libcxx) {