diff options
author | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-26 12:50:25 +0000 |
---|---|---|
committer | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-26 12:50:25 +0000 |
commit | 6f125c68f97f79303bb27aec2d31fa5e1e332afa (patch) | |
tree | 357ed9a16668e50862c385b913f3745f3c2b1239 /third_party/instrumented_libraries | |
parent | f6d85aa7bd69f08085a3795f2cf1877275bc1e95 (diff) | |
download | chromium_src-6f125c68f97f79303bb27aec2d31fa5e1e332afa.zip chromium_src-6f125c68f97f79303bb27aec2d31fa5e1e332afa.tar.gz chromium_src-6f125c68f97f79303bb27aec2d31fa5e1e332afa.tar.bz2 |
Fix download_build_install.py to use instrumented libraries as library dependencies.
BUG=313751
R=alextaran@chromium.org
Review URL: https://codereview.chromium.org/119133004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242524 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/instrumented_libraries')
-rwxr-xr-x | third_party/instrumented_libraries/download_build_install.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/third_party/instrumented_libraries/download_build_install.py b/third_party/instrumented_libraries/download_build_install.py index 144f03f..fe3601ed 100755 --- a/third_party/instrumented_libraries/download_build_install.py +++ b/third_party/instrumented_libraries/download_build_install.py @@ -11,7 +11,13 @@ import shutil import subprocess import sys -# Build parameters for different sanitizers +# Build parameters for different sanitizers. +# 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 +# differently escaped. Instead of having problems with that it just +# uses XORIGIN to build library and after that replaces it to $ORIGIN +# directly in .so file. SUPPORTED_SANITIZERS = { 'asan': { 'compiler_flags': '-fsanitize=address -gline-tables-only -fPIC -w', @@ -102,23 +108,21 @@ def download_build_install(parsed_arguments): parsed_arguments.custom_c_compiler_flags) environment['CXXFLAGS'] = '%s %s' % (sanitizer_params['compiler_flags'], parsed_arguments.custom_cxx_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 - # differently escaped. Instead of having problems with that it just - # uses XORIGIN to build library and after that replaces it to $ORIGIN - # directly in .so file. - environment['LDFLAGS'] = '%s %s' % (sanitizer_params['linker_flags'], - parsed_arguments.custom_linker_flags) - library_directory = '%s/%s' % (parsed_arguments.intermediate_directory, - parsed_arguments.library) - install_prefix = '%s/%s/instrumented_libraries/%s' % ( get_script_absolute_path(), parsed_arguments.product_directory, parsed_arguments.sanitizer_type) + # Make sure the linker searches the instrumented libraries dir for + # library dependencies. + environment['LDFLAGS'] = '%s -L%s/lib %s' % (sanitizer_params['linker_flags'], + install_prefix, + parsed_arguments.custom_linker_flags) + + library_directory = '%s/%s' % (parsed_arguments.intermediate_directory, + parsed_arguments.library) + if not os.path.exists(library_directory): os.makedirs(library_directory) |