Chromium Code Reviews| Index: build/standalone.gypi |
| diff --git a/build/standalone.gypi b/build/standalone.gypi |
| index ee91e78899f0b9d726e10c978d89be49fdb98c88..98fe7c7fa94e7917935a3b61ca67c35bfbf07819 100644 |
| --- a/build/standalone.gypi |
| +++ b/build/standalone.gypi |
| @@ -36,6 +36,11 @@ |
| 'make_clang_dir%': '../third_party/llvm-build/Release+Asserts', |
| 'clang_xcode%': 0, |
| 'asan%': 0, |
| + 'msan%': 0, |
| + # 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, |
| 'tsan%': 0, |
| 'visibility%': 'hidden', |
| 'v8_enable_backtrace%': 0, |
| @@ -201,34 +206,60 @@ |
| ], |
| }, |
| 'conditions': [ |
| - ['asan==1', { |
| + ['asan==1 or msan==1 or tsan==1', { |
| 'target_defaults': { |
| 'cflags_cc+': [ |
| '-fno-omit-frame-pointer', |
| '-gline-tables-only', |
| - '-fsanitize=address', |
| - '-w', # http://crbug.com/162783 |
| ], |
| 'cflags_cc!': [ |
| '-fomit-frame-pointer', |
| ], |
| 'ldflags': [ |
| + # Functions interposed by the sanitizers can make ld think |
| + # that some libraries aren't needed when they actually are, |
| + # http://crbug.com/234010. As workaround, disable --as-needed. |
| + '-Wl,--as-needed', |
|
earthdok
2014/12/19 15:54:02
this should be in "ldflags!", not "ldflags"
|
| + ], |
| + 'dependencies': [ |
| + # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of |
| + # stdlibc++ as standard library. This is intended to use for instrumented |
| + # builds. |
| + '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy', |
| + ], |
| + }, |
| + }], |
| + ['asan==1', { |
| + 'target_defaults': { |
| + 'cflags_cc+': [ |
| + '-fsanitize=address', |
| + ], |
| + 'ldflags': [ |
| '-fsanitize=address', |
| ], |
| }, |
| }], |
| + ['msan==1', { |
| + 'target_defaults': { |
| + 'cflags_cc+': [ |
| + '-fsanitize=memory', |
| + '-fsanitize-memory-track-origins=<(msan_track_origins)', |
| + ], |
| + 'ldflags': [ |
| + '-fsanitize=memory', |
| + ], |
| + 'defines': [ |
| + 'MEMORY_SANITIZER', |
| + ], |
| + }, |
| + }], |
| ['tsan==1', { |
| 'target_defaults': { |
| 'cflags+': [ |
| - '-fno-omit-frame-pointer', |
| - '-gline-tables-only', |
| '-fsanitize=thread', |
| '-fPIC', |
| '-Wno-c++11-extensions', |
| ], |
| - 'cflags!': [ |
| - '-fomit-frame-pointer', |
| - ], |
| 'ldflags': [ |
| '-fsanitize=thread', |
| '-pie', |