diff options
author | inferno <inferno@chromium.org> | 2015-01-20 08:15:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-20 16:16:47 +0000 |
commit | ac18f489dca8c902e4dfaa1a28d716b7914121d0 (patch) | |
tree | 11bb7cc4de09b8bb04270fc76b3fdcdeb264a5d0 | |
parent | 3e7dffcba9ee0ae3d96ac1b022af4768e26fe8e5 (diff) | |
download | chromium_src-ac18f489dca8c902e4dfaa1a28d716b7914121d0.zip chromium_src-ac18f489dca8c902e4dfaa1a28d716b7914121d0.tar.gz chromium_src-ac18f489dca8c902e4dfaa1a28d716b7914121d0.tar.bz2 |
Make UBSAN vptr work inside UBSAN and also add the UNDEFINED_SANITIZER define. Also, these can share the same blacklist file due to seperate prefixes.
TBR=glider@chromium.org,jochen@chromium.org
BUG=
Review URL: https://codereview.chromium.org/851163006
Cr-Commit-Position: refs/heads/master@{#312207}
-rw-r--r-- | build/common.gypi | 20 | ||||
-rw-r--r-- | tools/ubsan/blacklist.txt (renamed from tools/ubsan_vptr/blacklist.txt) | 0 |
2 files changed, 13 insertions, 7 deletions
diff --git a/build/common.gypi b/build/common.gypi index 33bf25b..46125c8 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -431,11 +431,11 @@ # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1 # See http://clang.llvm.org/docs/UsersManual.html 'ubsan%': 0, + 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt', # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option). # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1 'ubsan_vptr%': 0, - 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.txt', # Use the dynamic libraries instrumented by one of the sanitizers # instead of the standard system libraries. @@ -1130,8 +1130,8 @@ 'tsan%': '<(tsan)', 'tsan_blacklist%': '<(tsan_blacklist)', 'ubsan%': '<(ubsan)', + 'ubsan_blacklist%': '<(ubsan_blacklist)', 'ubsan_vptr%': '<(ubsan_vptr)', - 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)', 'use_instrumented_libraries%': '<(use_instrumented_libraries)', 'use_custom_libcxx%': '<(use_custom_libcxx)', 'use_system_libcxx%': '<(use_system_libcxx)', @@ -4216,8 +4216,7 @@ ['_toolset=="target"', { 'cflags': [ '-fsanitize=undefined', - # -fsanitize=vptr is incompatible with -fno-rtti. - '-fno-sanitize=vptr', + '-fsanitize-blacklist=<(ubsan_blacklist)', # Employ the experimental PBQP register allocator to avoid # slow compilation on files with too many basic blocks. # See http://crbug.com/426271. @@ -4226,10 +4225,17 @@ # generated by PBQP regallocator. May increase compile time. '-mllvm -pbqp-coalescing', ], + 'cflags_cc!': [ + '-fno-rtti', + ], + 'cflags!': [ + '-fno-rtti', + ], 'ldflags': [ '-fsanitize=undefined', - # -fsanitize=vptr is incompatible with -fno-rtti. - '-fno-sanitize=vptr', + ], + 'defines': [ + 'UNDEFINED_SANITIZER', ], }], ], @@ -4239,7 +4245,7 @@ ['_toolset=="target"', { 'cflags': [ '-fsanitize=vptr', - '-fsanitize-blacklist=<(ubsan_vptr_blacklist)', + '-fsanitize-blacklist=<(ubsan_blacklist)', ], 'cflags_cc!': [ '-fno-rtti', diff --git a/tools/ubsan_vptr/blacklist.txt b/tools/ubsan/blacklist.txt index 6b5915f..6b5915f 100644 --- a/tools/ubsan_vptr/blacklist.txt +++ b/tools/ubsan/blacklist.txt |