Index: gyp/common_conditions.gypi |
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi |
index 5fb45f6c4e0829e1c32bc0006c15fc78670e7c31..8221c94680a645a68b91927d83276065b042fb69 100644 |
--- a/gyp/common_conditions.gypi |
+++ b/gyp/common_conditions.gypi |
@@ -434,18 +434,14 @@ |
}], |
# Enable asan, tsan, etc. |
[ 'skia_sanitizer', { |
+ 'cflags_cc!': [ '-fno-rtti' ], # vptr needs rtti |
'cflags': [ |
'-fsanitize=<(skia_sanitizer)', # Turn on sanitizers. |
'-fno-sanitize-recover=<(skia_sanitizer)', # Make any failure fatal. |
'-fsanitize-blacklist=<(skia_sanitizer_blacklist)', # Compile in our blacklist. |
'-include <(skia_sanitizer_blacklist)', # Make every .cpp depend on it. |
], |
- 'cflags_cc!': [ |
- '-fno-rtti' |
- ], |
- 'ldflags': [ |
- '-fsanitize=<(skia_sanitizer)', |
- ], |
+ 'ldflags': [ '-fsanitize=<(skia_sanitizer)' ], |
'conditions' : [ |
[ 'skia_sanitizer == "thread"', { |
'defines': [ 'THREAD_SANITIZER' ], |
@@ -507,6 +503,21 @@ |
}, { |
'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)', |
}], |
+ [ 'skia_sanitizer', { |
+ 'GCC_ENABLE_CPP_RTTI': 'YES', # vptr needs rtti |
+ 'OTHER_CFLAGS': [ |
+ '-fsanitize=<(skia_sanitizer)', # Turn on sanitizers. |
+ '-fno-sanitize-recover=<(skia_sanitizer)', # Make any failure fatal. |
+ '-fsanitize-blacklist=<(skia_sanitizer_blacklist)', # Compile in our blacklist. |
+ '-include <(skia_sanitizer_blacklist)', # Make every .cpp depend on it. |
+ ], |
+ # We want to pass -fsanitize=... to our final link call, |
+ # but not to libtool. OTHER_LDFLAGS is passed to both. |
Nico
2016/05/13 17:06:02
...or you could check if _type is not static_libra
|
+ # To trick GYP into doing what we want, we'll piggyback on |
+ # LIBRARY_SEARCH_PATHS, producing "-L/usr/lib -fsanitize=...". |
+ # The -L/usr/lib is redundant but innocuous: it's a default path. |
+ 'LIBRARY_SEARCH_PATHS': [ '/usr/lib -fsanitize=<(skia_sanitizer)'], |
+ }], |
], |
'CLANG_CXX_LIBRARY': 'libc++', |
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', |