diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-23 17:14:15 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-23 17:14:15 +0000 |
commit | a030ab64e25319d1969748c16b749b240c2d8514 (patch) | |
tree | 419c95812601351d211ab024534fe8f5515b66b0 | |
parent | 627e8ab70fb5070ae20a25f9bcdab17f0a3d7401 (diff) | |
download | chromium_src-a030ab64e25319d1969748c16b749b240c2d8514.zip chromium_src-a030ab64e25319d1969748c16b749b240c2d8514.tar.gz chromium_src-a030ab64e25319d1969748c16b749b240c2d8514.tar.bz2 |
MSan: introduce a GYP flag to control origin tracking.
By setting msan_track_origins, the user can now choose between no origin
tracking (0), simple tracking (1) and chained origins (2). The default is
still 1.
Note that this doesn't affect instrumented libraries build, and is not
currently compatible with instrumented libraries for values of
msan_track_origins other than 1.
BUG=178409
TBR=glider@chromium.org, thakis@chromium.org
NOTRY=true
TEST=compile
Review URL: https://codereview.chromium.org/339663009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279127 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/base.gyp | 8 | ||||
-rw-r--r-- | build/common.gypi | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/base/base.gyp b/base/base.gyp index 587e999..9f7b993 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -1006,11 +1006,9 @@ ], }], ], - 'cflags!': [ - '-fsanitize=address', - '-fsanitize=thread', - '-fsanitize=memory', - '-fsanitize-memory-track-origins', + 'cflags/': [ + ['exclude', '-fsanitize='], + ['exclude', '-fsanitize-'], ], 'direct_dependent_settings': { 'ldflags': [ diff --git a/build/common.gypi b/build/common.gypi index 166130c..d94cb48 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -353,7 +353,8 @@ # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer 'asan%': 0, # Enable coverage gathering instrumentation in ASan. This flag also - # controls coverage granularity (experimental). + # controls coverage granularity (1 for function-level coverage, 2 for + # block-level coverage). 'asan_coverage%': 0, # Enable Chromium overrides of the default configurations for various @@ -380,6 +381,10 @@ # See http://clang.llvm.org/docs/MemorySanitizer.html 'msan%': 0, 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt', + # Track where uninitialized memory originates from. From fastest to + # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2 + # - track the chain of stores leading from allocation site to use site. + 'msan_track_origins%': 1, # Enable building with UBSan (Clang's -fsanitize=undefined option). # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1 @@ -1066,6 +1071,7 @@ 'lsan%': '<(lsan)', 'msan%': '<(msan)', 'msan_blacklist%': '<(msan_blacklist)', + 'msan_track_origins%': '<(msan_track_origins)', 'tsan%': '<(tsan)', 'tsan_blacklist%': '<(tsan_blacklist)', 'ubsan%': '<(ubsan)', @@ -3977,7 +3983,7 @@ ['_toolset=="target"', { 'cflags': [ '-fsanitize=memory', - '-fsanitize-memory-track-origins', + '-fsanitize-memory-track-origins=<(msan_track_origins)', '-fPIC', '-fsanitize-blacklist=<(msan_blacklist)', ], |