diff options
author | alextaran@chromium.org <alextaran@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-24 23:07:11 +0000 |
---|---|---|
committer | alextaran@chromium.org <alextaran@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-24 23:07:11 +0000 |
commit | 7c90213a5118cebbadd8474e28fa4f59307cf193 (patch) | |
tree | 4295d946d09cf9210eaab8a8c2921220afe8ee3f /third_party | |
parent | fd51f1d441e73be4eae3ef7f990c7b5e73699daa (diff) | |
download | chromium_src-7c90213a5118cebbadd8474e28fa4f59307cf193.zip chromium_src-7c90213a5118cebbadd8474e28fa4f59307cf193.tar.gz chromium_src-7c90213a5118cebbadd8474e28fa4f59307cf193.tar.bz2 |
Add custom compiler flags to instrumented libraries build script.
Needed for gtk and potentially other libs.
BUG=313751
R=glider@chromium.org
Review URL: https://codereview.chromium.org/103783006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
3 files changed, 10 insertions, 2 deletions
diff --git a/third_party/instrumented_libraries/download_build_install.py b/third_party/instrumented_libraries/download_build_install.py index c7f51d809..144f03f 100755 --- a/third_party/instrumented_libraries/download_build_install.py +++ b/third_party/instrumented_libraries/download_build_install.py @@ -98,8 +98,10 @@ 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'] = sanitizer_params['compiler_flags'] - environment['CXXFLAGS'] = sanitizer_params['compiler_flags'] + environment['CFLAGS'] = '%s %s' % (sanitizer_params['compiler_flags'], + 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 @@ -166,6 +168,8 @@ def main(): argument_parser.add_argument('-m', '--intermediate-directory', default='.', help='Relative path to the directory for temporary build files') argument_parser.add_argument('--custom-configure-flags', default='') + argument_parser.add_argument('--custom-c-compiler-flags', default='') + argument_parser.add_argument('--custom-cxx-compiler-flags', default='') argument_parser.add_argument('--custom-linker-flags', default='') argument_parser.add_argument('-s', '--sanitizer-type', required=True, choices=SUPPORTED_SANITIZERS.keys()) diff --git a/third_party/instrumented_libraries/instrumented_libraries.gyp b/third_party/instrumented_libraries/instrumented_libraries.gyp index a8dea99..335ca0f 100644 --- a/third_party/instrumented_libraries/instrumented_libraries.gyp +++ b/third_party/instrumented_libraries/instrumented_libraries.gyp @@ -5,6 +5,8 @@ { # Default value for all libraries. 'custom_configure_flags': '', + 'custom_c_compiler_flags': '', + 'custom_cxx_compiler_flags': '', 'custom_linker_flags': '', 'run_before_build': '', diff --git a/third_party/instrumented_libraries/standard_instrumented_library_target.gypi b/third_party/instrumented_libraries/standard_instrumented_library_target.gypi index 29f2dc1..2bc2de2 100644 --- a/third_party/instrumented_libraries/standard_instrumented_library_target.gypi +++ b/third_party/instrumented_libraries/standard_instrumented_library_target.gypi @@ -23,6 +23,8 @@ '--intermediate-directory=<(INTERMEDIATE_DIR)', '--sanitizer-type=<(_sanitizer_type)', '--custom-configure-flags=<(_custom_configure_flags)', + '--custom-c-compiler-flags=<(_custom_c_compiler_flags)', + '--custom-cxx-compiler-flags=<(_custom_cxx_compiler_flags)', '--custom-linker-flags=<(_custom_linker_flags)', '--run-before-build=<(_run_before_build)', '<(_verbose_libraries_build_flag)', |