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

Unified Diff: third_party/instrumented_libraries/download_build_install.py

Issue 96083003: Add instrumented libraries build with msan (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years 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
Index: third_party/instrumented_libraries/download_build_install.py
===================================================================
--- third_party/instrumented_libraries/download_build_install.py (revision 238347)
+++ third_party/instrumented_libraries/download_build_install.py (working copy)
@@ -12,7 +12,12 @@
import sys
# Should be a dict from 'sanitizer type' to 'compiler flag'.
-SUPPORTED_SANITIZERS = {'asan': 'address'}
+SUPPORTED_SANITIZERS = {
alextaran1 2013/12/03 11:35:47 Looks like a part of gyp-file. Not sure should thi
Alexander Potapenko 2013/12/03 11:46:46 Yeah, probably. Let us leave it as is and then ref
+ 'asan': {'compiler_flags': '-fsanitize=address -g -fPIC -w'},
Alexander Potapenko 2013/12/03 11:46:46 Please use -gline-tables-only instead of -g.
+ 'msan': {'compiler_flags':
+ '-fsanitize=memory -fsanitize-memory-track-origins -g -fPIC -w'
+ },
+}
class ScopedChangeDirectory(object):
@@ -37,16 +42,18 @@
command = 'apt-get -s build-dep %s | grep Inst | cut -d " " -f 2' % library
command_result = subprocess.Popen(command, stdout=subprocess.PIPE,
shell=True)
+ if command_result.wait():
+ raise Exception("Failed to determine build dependencies for %s" % library)
build_dependencies = [l.strip() for l in command_result.stdout]
return build_dependencies
def download_build_install(parsed_arguments):
- sanitizer_flag = SUPPORTED_SANITIZERS[parsed_arguments.sanitizer_type]
+ sanitizer_params = SUPPORTED_SANITIZERS[parsed_arguments.sanitizer_type]
environment = os.environ.copy()
- environment['CFLAGS'] = '-fsanitize=%s -g -fPIC -w' % sanitizer_flag
- environment['CXXFLAGS'] = '-fsanitize=%s -g -fPIC -w' % sanitizer_flag
+ environment['CFLAGS'] = sanitizer_params['compiler_flags']
+ environment['CXXFLAGS'] = sanitizer_params['compiler_flags']
# We use XORIGIN as RPATH and after building library replace it to $ORIGIN
# The reason: this flag goes through configure script and makefiles
# differently for different libraries. So the dollar sign '$' should be

Powered by Google App Engine
This is Rietveld 408576698