aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/cpp
diff options
context:
space:
mode:
authorGravatar jfield <jfield@google.com>2017-04-17 17:03:06 +0200
committerGravatar Klaus Aehlig <aehlig@google.com>2017-04-18 11:30:45 +0200
commitba8b2d987674c6cc670b85743c0fc75e86b721c3 (patch)
treea1e313f864e63f9f467d0d2dd1770640b23171b8 /tools/cpp
parentae1d0dec94e4f4b7066ce1c65d4f035907540586 (diff)
Automated g4 rollback of commit 045104899738594d85f9ab9b0b9ccbde320b8055.
*** Reason for rollback *** Breaks internal tests that use nonstandard crosstools *** Original change description *** Make C++ archiving use action_configs instead of hardcoded flags RELNOTES: Use action_config in crosstool for static library archiving, remove ar_flag. PiperOrigin-RevId: 153344597
Diffstat (limited to 'tools/cpp')
-rw-r--r--tools/cpp/CROSSTOOL3
-rw-r--r--tools/cpp/CROSSTOOL.tpl27
-rw-r--r--tools/cpp/cc_configure.bzl1
3 files changed, 12 insertions, 19 deletions
diff --git a/tools/cpp/CROSSTOOL b/tools/cpp/CROSSTOOL
index d649b9617f..8bcf94cfe7 100644
--- a/tools/cpp/CROSSTOOL
+++ b/tools/cpp/CROSSTOOL
@@ -220,6 +220,9 @@ toolchain {
tool_path { name: "dwp" path: "/usr/bin/dwp" }
tool_path { name: "gcc" path: "osx_cc_wrapper.sh" }
cxx_flag: "-std=c++0x"
+ ar_flag: "-static"
+ ar_flag: "-s"
+ ar_flag: "-o"
linker_flag: "-lstdc++"
linker_flag: "-undefined"
linker_flag: "dynamic_lookup"
diff --git a/tools/cpp/CROSSTOOL.tpl b/tools/cpp/CROSSTOOL.tpl
index b01819a2eb..60fb955e95 100644
--- a/tools/cpp/CROSSTOOL.tpl
+++ b/tools/cpp/CROSSTOOL.tpl
@@ -411,7 +411,6 @@ toolchain {
tool {
tool_path: 'wrapper/bin/msvc_link.bat'
}
- implies: 'cc_archiver_flags'
implies: 'input_param_flags'
implies: 'linker_param_file'
implies: 'msvc_env'
@@ -423,7 +422,6 @@ toolchain {
tool {
tool_path: 'wrapper/bin/msvc_link.bat'
}
- implies: 'cc_archiver_flags'
implies: 'input_param_flags'
implies: 'linker_param_file'
implies: 'msvc_env'
@@ -437,7 +435,6 @@ toolchain {
tool {
tool_path: 'wrapper/bin/msvc_link.bat'
}
- implies: 'cc_archiver_flags'
implies: 'input_param_flags'
implies: 'linker_param_file'
implies: 'msvc_env'
@@ -449,7 +446,6 @@ toolchain {
tool {
tool_path: 'wrapper/bin/msvc_link.bat'
}
- implies: 'cc_archiver_flags'
implies: 'input_param_flags'
implies: 'linker_param_file'
implies: 'msvc_env'
@@ -518,26 +514,15 @@ toolchain {
}
feature {
- name: 'cc_archiver_flags'
- flag_set {
- expand_if_all_available: 'output_execpath'
- action: 'c++-link-static-library'
- action: 'c++-link-alwayslink-static-library'
- action: 'c++-link-pic-static-library'
- action: 'c++-link-alwayslink-pic-static-library'
- flag_group {
- flag: 'rcsD'
- flag: '%{output_execpath}'
- }
- }
- }
-
- feature {
name: 'input_param_flags'
flag_set {
expand_if_all_available: 'library_search_directories'
action: 'c++-link-executable'
action: 'c++-link-dynamic-library'
+ action: 'c++-link-static-library'
+ action: 'c++-link-alwayslink-static-library'
+ action: 'c++-link-pic-static-library'
+ action: 'c++-link-alwayslink-pic-static-library'
flag_group {
iterate_over: 'library_search_directories'
flag: "-L%{library_search_directories}"
@@ -547,6 +532,10 @@ toolchain {
expand_if_all_available: 'libopts'
action: 'c++-link-executable'
action: 'c++-link-dynamic-library'
+ action: 'c++-link-static-library'
+ action: 'c++-link-alwayslink-static-library'
+ action: 'c++-link-pic-static-library'
+ action: 'c++-link-alwayslink-pic-static-library'
flag_group {
flag: '%{libopts}'
}
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index 6ccdd77b0c..4e77db5e6b 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -269,6 +269,7 @@ def _crosstool_content(repository_ctx, cc, cpu_value, darwin):
repository_ctx, cc, "-pass-exit-codes"
)
),
+ "ar_flag": ["-static", "-s", "-o"] if darwin else [],
"cxx_builtin_include_directory": _get_cxx_inc_directories(repository_ctx, cc),
"objcopy_embed_flag": ["-I", "binary"],
"unfiltered_cxx_flag":