diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-25 15:27:13 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-25 15:27:13 +0000 |
commit | 671d33072bfcc49a6aeac7559d349e7bc0d994e9 (patch) | |
tree | 467db34bd88cc9ca206108f7c3bdc11e3eb6f13a /third_party | |
parent | c1531f596f449c011cfdcbf053714af0385374c7 (diff) | |
download | chromium_src-671d33072bfcc49a6aeac7559d349e7bc0d994e9.zip chromium_src-671d33072bfcc49a6aeac7559d349e7bc0d994e9.tar.gz chromium_src-671d33072bfcc49a6aeac7559d349e7bc0d994e9.tar.bz2 |
Instrumented libraries: pass MSan, TSan blacklists when building.
Also, use this to blacklist a function which is crashing due to an MSan bug.
Also, fix a small issue in DESTDIR builds which I discovered while testing this.
BUG=313751
R=glider@chromium.org
NOTRY=true
TEST=msan
Review URL: https://codereview.chromium.org/253613002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
3 files changed, 20 insertions, 6 deletions
diff --git a/third_party/instrumented_libraries/download_build_install.py b/third_party/instrumented_libraries/download_build_install.py index 1daf71e..de5ee0a 100755 --- a/third_party/instrumented_libraries/download_build_install.py +++ b/third_party/instrumented_libraries/download_build_install.py @@ -129,7 +129,7 @@ def destdir_configure_make_install(parsed_arguments, environment, # errors in dependent libraries. 'rm %s/lib/*.la -f' % destdir, # Now move the contents of the temporary destdir to their final place. - 'cp %s/* %s/ -rd' % (destdir, install_prefix)], + 'cp %s/* %s/ -rdf' % (destdir, install_prefix)], parsed_arguments.verbose, environment) @@ -265,15 +265,24 @@ def download_build_install(parsed_arguments): environment['CC'] = parsed_arguments.c_compiler if 'CXX' not in environment and parsed_arguments.cxx_compiler: environment['CXX'] = parsed_arguments.cxx_compiler - environment['CFLAGS'] = '%s %s' % (sanitizer_params['compiler_flags'], + + product_directory = os.path.normpath('%s/%s' % ( + get_script_absolute_path(), + parsed_arguments.product_directory)) + + compiler_flags = sanitizer_params['compiler_flags'] + if parsed_arguments.sanitizer_blacklist: + compiler_flags += ' -fsanitize-blacklist=%s/%s' % ( + product_directory, + parsed_arguments.sanitizer_blacklist) + environment['CFLAGS'] = '%s %s' % (compiler_flags, parsed_arguments.custom_c_compiler_flags) environment['CXXFLAGS'] = '%s %s' % ( - sanitizer_params['compiler_flags'], + compiler_flags, parsed_arguments.custom_cxx_compiler_flags) - install_prefix = '%s/%s/instrumented_libraries/%s' % ( - get_script_absolute_path(), - parsed_arguments.product_directory, + install_prefix = '%s/instrumented_libraries/%s' % ( + product_directory, parsed_arguments.sanitizer_type) # Make sure the linker searches the instrumented libraries dir for @@ -350,6 +359,7 @@ def main(): # e.g. extracting archives with sources, patching makefiles, etc. argument_parser.add_argument('--run-before-build', default='') argument_parser.add_argument('--build-method', default='destdir') + argument_parser.add_argument('--sanitizer-blacklist', default='') # Ignore all empty arguments because in several cases gyp passes them to the # script, but ArgumentParser treats them as positional arguments instead of diff --git a/third_party/instrumented_libraries/instrumented_libraries.gyp b/third_party/instrumented_libraries/instrumented_libraries.gyp index b3158cb..a2ac31e 100644 --- a/third_party/instrumented_libraries/instrumented_libraries.gyp +++ b/third_party/instrumented_libraries/instrumented_libraries.gyp @@ -21,12 +21,15 @@ 'conditions': [ ['asan==1', { 'sanitizer_type': 'asan', + 'sanitizer_blacklist': '', }], ['msan==1', { 'sanitizer_type': 'msan', + 'sanitizer_blacklist': '<(msan_blacklist)', }], ['tsan==1', { 'sanitizer_type': 'tsan', + 'sanitizer_blacklist': '<(tsan_blacklist)', }], ['verbose_libraries_build==1', { 'verbose_libraries_build_flag': '--verbose', diff --git a/third_party/instrumented_libraries/standard_instrumented_library_target.gypi b/third_party/instrumented_libraries/standard_instrumented_library_target.gypi index 6c634f9..c23de19 100644 --- a/third_party/instrumented_libraries/standard_instrumented_library_target.gypi +++ b/third_party/instrumented_libraries/standard_instrumented_library_target.gypi @@ -34,6 +34,7 @@ '--cxx-compiler=<(_cxx)', '--jobs=<(_jobs)', '--build-method=<(_build_method)', + '--sanitizer-blacklist=<(_sanitizer_blacklist)', ], }, ], |