Reviewers: jochen, Sven Panne, Alexander Potapenko, earthdok,

Message:
PTAL


https://codereview.chromium.org/1158903002/diff/1/build/standalone.gypi
File build/standalone.gypi (right):

https://codereview.chromium.org/1158903002/diff/1/build/standalone.gypi#newcode399
build/standalone.gypi:399: ['OS=="mac"', {
Refactoring: I'm nesting the conditions the same way as in common.gypi
to ease copying stuff over. No intentional change to the mac asan
config.

Description:
[test] Add sanitizer coverage to gyp configs.

BUG=

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+54, -21 lines):
  M build/standalone.gypi


Index: build/standalone.gypi
diff --git a/build/standalone.gypi b/build/standalone.gypi
index c01c802386fab220ae95ba66f80d41d66de2ef28..fa2d8cfdeec77ff40ba411756323a513ceae37d0 100644
--- a/build/standalone.gypi
+++ b/build/standalone.gypi
@@ -76,6 +76,10 @@
       'lsan%': 0,
       'msan%': 0,
       'tsan%': 0,
+ # Enable coverage gathering instrumentation in sanitizer tools. This flag
+      # also controls coverage granularity (1 for function-level, 2 for
+      # block-level, 3 for edge-level).
+      'sanitizer_coverage%': 0,

       # goma settings.
       # 1 to use goma.
@@ -101,6 +105,7 @@
     'lsan%': '<(lsan)',
     'msan%': '<(msan)',
     'tsan%': '<(tsan)',
+    'sanitizer_coverage%': '<(sanitizer_coverage)',

     # Add a simple extra solely for the purpose of the cctests
     'v8_extra_library_files': ['../test/cctest/test-extra.js'],
@@ -321,7 +326,6 @@
               }],
             ],
           }],
-          # TODO(machenbach): Add sanitizer coverage.
           ['lsan==1', {
             'target_conditions': [
               ['_toolset=="target"', {
@@ -377,35 +381,64 @@
               '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
             ],
           }],
+          ['sanitizer_coverage!=0', {
+            'target_conditions': [
+              ['_toolset=="target"', {
+                'cflags': [
+                  '-fsanitize-coverage=<(sanitizer_coverage)',
+                ],
+                'defines': [
+                  'SANITIZER_COVERAGE',
+                ],
+              }],
+            ],
+          }],
         ],
       },
     }],
-    ['asan==1 and OS=="mac"', {
+    ['OS=="mac"', {
       'target_defaults': {
-        'xcode_settings': {
-          'OTHER_CFLAGS+': [
-            '-fno-omit-frame-pointer',
-            '-gline-tables-only',
-            '-fsanitize=address',
-            '-w',  # http://crbug.com/162783
-          ],
-          'OTHER_CFLAGS!': [
-            '-fomit-frame-pointer',
-          ],
-          'defines': [
-            'ADDRESS_SANITIZER',
-          ],
-        },
+       'conditions': [
+          ['asan==1', {
+            'xcode_settings': {
+ # FIXME(machenbach): This is outdated compared to common.gypi.
+              'OTHER_CFLAGS+': [
+                '-fno-omit-frame-pointer',
+                '-gline-tables-only',
+                '-fsanitize=address',
+                '-w',  # http://crbug.com/162783
+              ],
+              'OTHER_CFLAGS!': [
+                '-fomit-frame-pointer',
+              ],
+              'defines': [
+                'ADDRESS_SANITIZER',
+              ],
+            },
+            'dependencies': [
+              '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
+            ],
+          }],
+          ['sanitizer_coverage!=0', {
+            'target_conditions': [
+              ['_toolset=="target"', {
+                'cflags': [
+                  '-fsanitize-coverage=<(sanitizer_coverage)',
+                ],
+                'defines': [
+                  'SANITIZER_COVERAGE',
+                ],
+              }],
+            ],
+          }],
+        ],
         'target_conditions': [
           ['_type!="static_library"', {
             'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
           }],
         ],
-        'dependencies': [
-          '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
-        ],
-      },
-    }],
+      },  # target_defaults
+    }],  # OS=="mac"
     ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
        or OS=="netbsd" or OS=="aix"', {
       'target_defaults': {


--
--
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