diff options
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)', |