[libcxx] Add support for sanitizers on OS X.
Summary: This patch adds special configuration logic to find the compiler_rt libraries required by sanitizers on OS X. The supported sanitizers are Address and Undefined. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11381 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -623,6 +623,8 @@ class Configuration(object):
|
||||
'-fno-sanitize-recover']
|
||||
self.cxx.compile_flags += ['-O3']
|
||||
self.config.available_features.add('ubsan')
|
||||
if self.target_info.platform() == 'darwin':
|
||||
self.config.available_features.add('sanitizer-new-delete')
|
||||
elif san == 'Thread':
|
||||
self.cxx.flags += ['-fsanitize=thread']
|
||||
self.config.available_features.add('tsan')
|
||||
@@ -630,6 +632,10 @@ class Configuration(object):
|
||||
else:
|
||||
self.lit_config.fatal('unsupported value for '
|
||||
'use_sanitizer: {0}'.format(san))
|
||||
san_lib = self.get_lit_conf('sanitizer_library')
|
||||
if san_lib:
|
||||
self.cxx.link_flags += [
|
||||
san_lib, '-Wl,-rpath,%s' % os.path.dirname(san_lib)]
|
||||
|
||||
def configure_coverage(self):
|
||||
self.generate_coverage = self.get_lit_bool('generate_coverage', False)
|
||||
|
Reference in New Issue
Block a user