Reviewers: Hannes Payer, jochen,

Message:
PTAL

Description:
Add tsan support to v8's gyp and test driver.

Tests only the default variant for now.

BUG=

Please review this at https://codereview.chromium.org/412853002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+30, -0 lines):
  M build/standalone.gypi
  M tools/run-deopt-fuzzer.py
  M tools/run-tests.py


Index: build/standalone.gypi
diff --git a/build/standalone.gypi b/build/standalone.gypi
index 932a4686a3ebe3d15824425ab4602836507e8ad0..1fcb8860b4d10e813358b6360699883ce85f4807 100644
--- a/build/standalone.gypi
+++ b/build/standalone.gypi
@@ -35,6 +35,7 @@
     'component%': 'static_library',
     'clang%': 0,
     'asan%': 0,
+    'tsan%': 0,
     'visibility%': 'hidden',
     'v8_enable_backtrace%': 0,
     'v8_enable_i18n_support%': 1,
@@ -186,6 +187,27 @@
         ],
       },
     }],
+    ['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',
+        ],
+        'defines': [
+          'THREAD_SANITIZER',
+        ],
+      },
+    }],
     ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
        or OS=="netbsd"', {
       'target_defaults': {
Index: tools/run-deopt-fuzzer.py
diff --git a/tools/run-deopt-fuzzer.py b/tools/run-deopt-fuzzer.py
index b3ea2aa42d30aded28cc9dac2837db6db79ca94f..57cb6b278c5c762add2e7b94ad94cb8acdd5eb13 100755
--- a/tools/run-deopt-fuzzer.py
+++ b/tools/run-deopt-fuzzer.py
@@ -388,6 +388,7 @@ def Execute(arch, mode, args, options, suites, workspace):
     "no_snap": False,
     "simulator": utils.UseSimulator(arch),
     "system": utils.GuessOS(),
+    "tsan": False,
   }
   all_tests = []
   num_tests = 0
Index: tools/run-tests.py
diff --git a/tools/run-tests.py b/tools/run-tests.py
index 1077c3e534a69f029c669dffe7a72801e340d80b..d1eb3a339171f3281171c21ac495da890d3f3553 100755
--- a/tools/run-tests.py
+++ b/tools/run-tests.py
@@ -213,6 +213,9 @@ def BuildOptions():
                     default=False, action="store_true")
   result.add_option("-t", "--timeout", help="Timeout in seconds",
                     default= -1, type="int")
+  result.add_option("--tsan",
+                    help="Regard test expectations for TSAN",
+                    default=False, action="store_true")
   result.add_option("-v", "--verbose", help="Verbose output",
                     default=False, action="store_true")
   result.add_option("--valgrind", help="Run tests through valgrind",
@@ -275,6 +278,9 @@ def ProcessOptions(options):
   if options.asan:
     options.extra_flags.append("--invoke-weak-callbacks")

+  if options.tsan:
+    VARIANTS = ["default"]
+
   if options.j == 0:
     options.j = multiprocessing.cpu_count()

@@ -459,6 +465,7 @@ def Execute(arch, mode, args, options, suites, workspace):
     "simulator_run": simulator_run,
     "simulator": utils.UseSimulator(arch),
     "system": utils.GuessOS(),
+    "tsan": options.tsan,
   }
   all_tests = []
   num_tests = 0


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to