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: http://src.chromium.org/svn/trunk/src/build@279127 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
earthdok@chromium.org 2014-06-23 17:14:15 +00:00
Родитель 4508cff0f3
Коммит aebcc92199
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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)',
],