From eb6a23609da39c7e20c47ee6d041466ce9a7b63c Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 4 Oct 2019 16:03:45 -0700 Subject: [PATCH] Wire up memory sanitizer. (#321) --- build/config/BUILDCONFIG.gn | 4 ++++ build/config/compiler/BUILD.gn | 9 ++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 594800f2eb3..8a663cf42af 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -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 # ============================================================================= diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 0ff77a32928..8122a99f09a 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -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) {