Index: third_party/instrumented_libraries/download_build_install.py |
diff --git a/third_party/instrumented_libraries/download_build_install.py b/third_party/instrumented_libraries/download_build_install.py |
index dd5cc45fde00f0cf65455b5eaf527efae0e315c7..4ea25d75c2f055ef01b2298cfd84a2f6f71f9496 100755 |
--- a/third_party/instrumented_libraries/download_build_install.py |
+++ b/third_party/instrumented_libraries/download_build_install.py |
@@ -205,21 +205,19 @@ def build_and_install(parsed_arguments, environment, install_prefix): |
libcap2_make_install(parsed_arguments, environment, install_prefix) |
elif parsed_arguments.build_method == 'custom_libpci3': |
libpci3_make_install(parsed_arguments, environment, install_prefix) |
- elif parsed_arguments.build_method == 'custom_libappindicator1': |
- environment['CSC'] = '/usr/bin/mono-csc' |
- destdir_configure_make_install( |
- parsed_arguments, environment, install_prefix) |
else: |
raise Exception('Unrecognized build method: %s' % |
parsed_arguments.build_method) |
+ |
def unescape_flags(s): |
# GYP escapes the build flags as if they are going to be inserted directly |
# into the command line. Since we pass them via CFLAGS/LDFLAGS, we must drop |
# the double quotes accordingly. |
return ' '.join(shlex.split(s)) |
-def download_build_install(parsed_arguments): |
+ |
+def build_environment(parsed_arguments, product_directory, install_prefix): |
environment = os.environ.copy() |
# The CC/CXX environment variables take precedence over the command line |
# flags. |
@@ -228,10 +226,6 @@ def download_build_install(parsed_arguments): |
if 'CXX' not in environment and parsed_arguments.cxx: |
environment['CXX'] = parsed_arguments.cxx |
- product_directory = os.path.normpath('%s/%s' % ( |
- get_script_absolute_path(), |
- parsed_arguments.product_directory)) |
- |
cflags = unescape_flags(parsed_arguments.cflags) |
if parsed_arguments.sanitizer_blacklist: |
cflags += ' -fsanitize-blacklist=%s/%s' % ( |
@@ -240,15 +234,34 @@ def download_build_install(parsed_arguments): |
environment['CFLAGS'] = cflags |
environment['CXXFLAGS'] = cflags |
- install_prefix = '%s/instrumented_libraries/%s' % ( |
- product_directory, |
- parsed_arguments.sanitizer_type) |
- |
ldflags = unescape_flags(parsed_arguments.ldflags) |
# Make sure the linker searches the instrumented libraries dir for |
# library dependencies. |
environment['LDFLAGS'] = '%s -L%s/lib' % (ldflags, install_prefix) |
+ if parsed_arguments.sanitizer_type == 'asan': |
+ # Do not report leaks during the build process. |
+ environment['ASAN_OPTIONS'] = '%s:detect_leaks=0' % \ |
+ environment.get('ASAN_OPTIONS', '') |
+ |
+ # libappindicator1 needs this. |
+ environment['CSC'] = '/usr/bin/mono-csc' |
+ return environment |
+ |
+ |
+ |
+def download_build_install(parsed_arguments): |
+ product_directory = os.path.normpath('%s/%s' % ( |
+ get_script_absolute_path(), |
+ parsed_arguments.product_directory)) |
+ |
+ install_prefix = '%s/instrumented_libraries/%s' % ( |
+ product_directory, |
+ parsed_arguments.sanitizer_type) |
+ |
+ environment = build_environment(parsed_arguments, product_directory, |
+ install_prefix) |
+ |
package_directory = '%s/%s' % (parsed_arguments.intermediate_directory, |
parsed_arguments.package) |