Commit 8216f1bc authored by jochen's avatar jochen Committed by Commit bot

Add ASAN and TSAN support for Mac

BUG=none
LOG=n
R=machenbach@chromium.org,glider@chromium.org

Review URL: https://codereview.chromium.org/838383005

Cr-Commit-Position: refs/heads/master@{#26013}
parent 21ce2464
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'asan_dynamic_runtime',
'toolsets': ['target', 'host'],
'type': 'none',
'variables': {
# Every target is going to depend on asan_dynamic_runtime, so allow
# this one to depend on itself.
'prune_self_dependency': 1,
# Path is relative to this GYP file.
'asan_rtl_mask_path':
'../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin',
'asan_osx_dynamic':
'<(asan_rtl_mask_path)/libclang_rt.asan_osx_dynamic.dylib',
'asan_iossim_dynamic':
'<(asan_rtl_mask_path)/libclang_rt.asan_iossim_dynamic.dylib',
},
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'files': [
'<!(/bin/ls <(asan_osx_dynamic))',
],
},
],
},
],
}
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
], ],
}, },
'conditions': [ 'conditions': [
['asan==1', { ['asan==1 and OS!="mac"', {
'target_defaults': { 'target_defaults': {
'cflags_cc+': [ 'cflags_cc+': [
'-fno-omit-frame-pointer', '-fno-omit-frame-pointer',
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
'-fsanitize=address', '-fsanitize=address',
'-w', # http://crbug.com/162783 '-w', # http://crbug.com/162783
], ],
'cflags_cc!': [ 'cflags!': [
'-fomit-frame-pointer', '-fomit-frame-pointer',
], ],
'ldflags': [ 'ldflags': [
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
], ],
}, },
}], }],
['tsan==1', { ['tsan==1 and OS!="mac"', {
'target_defaults': { 'target_defaults': {
'cflags+': [ 'cflags+': [
'-fno-omit-frame-pointer', '-fno-omit-frame-pointer',
...@@ -238,6 +238,29 @@ ...@@ -238,6 +238,29 @@
], ],
}, },
}], }],
['asan==1 and 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',
],
},
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
}],
],
'dependencies': [
'<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
],
},
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd"', { or OS=="netbsd"', {
'target_defaults': { 'target_defaults': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment