Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: build/common.gypi

Issue 10700061: Add the 'tsan' GYP flag (off by default) that enables compiler-based data race detection with Threa… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
===================================================================
--- build/common.gypi (revision 145435)
+++ build/common.gypi (working copy)
@@ -223,6 +223,11 @@
# See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
'asan%': 0,
+ # Enable building with TSAN (Clang's -fthread-sanitizer option).
+ # -fthread-sanitizer only works with clang, but tsan=1 implies clang=1
+ # See http://clang.llvm.org/docs/ThreadSanitizer.html
+ 'tsan%': 0,
+
# Set to true to instrument the code with function call logger.
# See src/third_party/cygprofile/cyg-profile.cc for details.
'order_profiling%': 0,
@@ -560,6 +565,7 @@
'notifications%': '<(notifications)',
'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
'asan%': '<(asan)',
+ 'tsan%': '<(tsan)',
'order_profiling%': '<(order_profiling)',
'order_text_section%': '<(order_text_section)',
'enable_extensions%': '<(enable_extensions)',
@@ -1130,9 +1136,15 @@
'clang%': 1,
# Do not use Chrome plugins for Clang. The Clang version in
# third_party/asan may be different from the default one.
+ # TODO(glider): this isn't true anymore, need to check if we can use the
+ # plugins now.
'clang_use_chrome_plugins%': 0,
}],
+ ['tsan==1', {
+ 'clang%': 1,
+ }],
+
# On valgrind bots, override the optimizer settings so we don't inline too
# much and make the stacks harder to figure out.
#
@@ -2286,6 +2298,25 @@
}],
],
}],
+ ['tsan==1', {
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ '-fthread-sanitizer',
+ '-fno-omit-frame-pointer',
+ '-fPIE',
+ ],
+ 'ldflags': [
+ '-fthread-sanitizer',
+ '-pie',
+ ],
+ 'defines': [
+ 'THREAD_SANITIZER',
+ 'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
+ ],
+ }],
+ ],
+ }],
['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
'target_conditions' : [
['_toolset=="target"', {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698