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

Unified Diff: build/standalone.gypi

Issue 1158903002: [test] Add sanitizer coverage to gyp configs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oops Created 5 years, 7 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/standalone.gypi
diff --git a/build/standalone.gypi b/build/standalone.gypi
index c01c802386fab220ae95ba66f80d41d66de2ef28..dc4ce0084a0fe88dfe590696cab353191bc86d34 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',
- ],
- },
- 'target_conditions': [
- ['_type!="static_library"', {
- 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
+ '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',
+ ],
+ 'target_conditions': [
+ ['_type!="static_library"', {
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
+ }],
+ ],
+ }],
+ ['sanitizer_coverage!=0', {
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ '-fsanitize-coverage=<(sanitizer_coverage)',
+ ],
+ 'defines': [
+ 'SANITIZER_COVERAGE',
+ ],
+ }],
+ ],
}],
],
- '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': {
« 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