aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-01-24 10:48:33 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-24 10:50:34 -0800
commitaa8ce5653f92473b331e500a3614245dae38dfc4 (patch)
tree714bd5beb18a8d8f51b4ca52cc58375d1f3733f3 /src/main
parent667e85dcc749adcd8003e64a56d45b22dfbf4856 (diff)
RELNOTES: Fix how libraries to link is specified to archiver actions.
start-lib/end-lib should not be passed to ar. Fix how the libraries to link are passed to ar by not using the generic feature "libraries_to_link" PiperOrigin-RevId: 183107904
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java
index 9a28f7b5c9..c17dba687b 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java
@@ -455,7 +455,6 @@ public class CppActionConfigs {
" tool_path: '" + arToolPath + "'",
" }",
" implies: 'archiver_flags'",
- " implies: 'libraries_to_link'",
" implies: 'linker_param_file'",
"}",
"action_config {",
@@ -465,7 +464,6 @@ public class CppActionConfigs {
" tool_path: '" + arToolPath + "'",
" }",
" implies: 'archiver_flags'",
- " implies: 'libraries_to_link'",
" implies: 'linker_param_file'",
"}",
"action_config {",
@@ -475,7 +473,6 @@ public class CppActionConfigs {
" tool_path: '" + arToolPath + "'",
" }",
" implies: 'archiver_flags'",
- " implies: 'libraries_to_link'",
" implies: 'linker_param_file'",
"}",
"action_config {",
@@ -485,7 +482,6 @@ public class CppActionConfigs {
" tool_path: '" + arToolPath + "'",
" }",
" implies: 'archiver_flags'",
- " implies: 'libraries_to_link'",
" implies: 'linker_param_file'",
"}",
ifTrue(
@@ -617,6 +613,38 @@ public class CppActionConfigs {
" flag: '%{output_execpath}'"),
" }",
" }",
+ " flag_set { ",
+ " expand_if_all_available: 'libraries_to_link'",
+ " 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: 'libraries_to_link'",
+ " flag_group {",
+ " expand_if_equal {",
+ " variable: 'libraries_to_link.type'",
+ " value: 'object_file'",
+ " }",
+ " flag: '%{libraries_to_link.name}'",
+ " }",
+ " flag_group {",
+ " expand_if_equal {",
+ " variable: 'libraries_to_link.type'",
+ " value: 'object_file_group'",
+ " }",
+ " iterate_over: 'libraries_to_link.object_files'",
+ " flag: '%{libraries_to_link.object_files}'",
+ " }",
+ " flag_group {",
+ " expand_if_equal: {",
+ " variable: 'libraries_to_link.type'",
+ " value: 'static_library'",
+ " }",
+ " flag: '%{libraries_to_link.name}'",
+ " }",
+ " }",
+ " }",
"}"),
ifTrue(
!existingFeatureNames.contains("libraries_to_link"),
@@ -626,10 +654,6 @@ public class CppActionConfigs {
" expand_if_all_available: 'libraries_to_link'",
" 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: 'libraries_to_link'",
" flag_group {",