diff options
author | 2016-05-17 08:29:50 +0000 | |
---|---|---|
committer | 2016-05-17 16:17:44 +0000 | |
commit | b86809eea78cd8ac07f6086a98ea7d781f367726 (patch) | |
tree | cac51750205433026c9bd5d7e822aa88588f75ae /tools | |
parent | 45d48bf1fe7503acbbb0c095822b7f8f558881e8 (diff) |
Add -headerpad_max_install_names to darwin CROSSTOOL linker flags.
Fixes #1269
--
MOS_MIGRATED_REVID=122502116
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cpp/CROSSTOOL | 1 | ||||
-rw-r--r-- | tools/cpp/cc_configure.bzl | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/tools/cpp/CROSSTOOL b/tools/cpp/CROSSTOOL index 74a8d4e6de..5a23b587ba 100644 --- a/tools/cpp/CROSSTOOL +++ b/tools/cpp/CROSSTOOL @@ -217,6 +217,7 @@ toolchain { linker_flag: "-lstdc++" linker_flag: "-undefined" linker_flag: "dynamic_lookup" + linker_flag: "-headerpad_max_install_names" # TODO(ulfjack): This is wrong on so many levels. Figure out a way to auto-detect the proper # setting from the local compiler, and also how to make incremental builds correct. cxx_builtin_include_directory: "/" diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl index 226f10fdba..364305e0a1 100644 --- a/tools/cpp/cc_configure.bzl +++ b/tools/cpp/cc_configure.bzl @@ -182,7 +182,11 @@ def _crosstool_content(repository_ctx, cc, cpu_value, darwin): # Anticipated future default. ] + _add_option_if_supported(repository_ctx, cc, "-no-canonical-prefixes") + _add_option_if_supported(repository_ctx, cc, "-Wl,-no-as-needed") + ( - ["-undefined", "dynamic_lookup"] if darwin else [ + [ + "-undefined", + "dynamic_lookup", + "-headerpad_max_install_names", + ] if darwin else [ "-B" + str(repository_ctx.path(cc).dirname), # Always have -B/usr/bin, see https://github.com/bazelbuild/bazel/issues/760. "-B/usr/bin", |