aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2018-03-01 13:17:23 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-01 13:19:47 -0800
commitdad2276e54f504b4e9ee0107e845b838d0a9b956 (patch)
tree997caeaede0460026d2b3279133197cd3f157928 /src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
parent4b6c0ec4b54e258763ce22e1a7f529d293aff026 (diff)
Introduce a specific action_config for linking nodeps dynamic libraries
With this cl toolchain author can specify different flags for linking shared library produced by cc_library and a shared library produced by cc_binary. This is what is needed to remove linking_mode_flags - MOSTLY_STATIC_LIBRARIES from the crosstool. What this linking mode was used for was to separate when we link transitive shared library from cc_binary and when we link this little-and-not-really-useful-outside-of-bazel nodeps shared library in cc_library. RELNOTES: CcToolchain: Introduced action_config for "c++-link-transitive-dynamic-library" PiperOrigin-RevId: 187523334
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
index ab5329f6c8..3c3a6d41a3 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
@@ -107,6 +107,7 @@ public class CppLinkActionTest extends BuildViewTestCase {
.getFeatureConfiguration(
ImmutableSet.of(
Link.LinkTargetType.EXECUTABLE.getActionName(),
+ Link.LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName(),
Link.LinkTargetType.DYNAMIC_LIBRARY.getActionName(),
Link.LinkTargetType.STATIC_LIBRARY.getActionName(),
Link.LinkTargetType.PIC_STATIC_LIBRARY.getActionName(),
@@ -324,7 +325,7 @@ public class CppLinkActionTest extends BuildViewTestCase {
featureConfiguration,
MockCppSemantics.INSTANCE) {};
if (attributesToFlip.contains(NonStaticAttributes.OUTPUT_FILE)) {
- builder.setLinkType(LinkTargetType.DYNAMIC_LIBRARY);
+ builder.setLinkType(LinkTargetType.NODEPS_DYNAMIC_LIBRARY);
builder.setLibraryIdentifier("foo");
} else {
builder.setLinkType(LinkTargetType.EXECUTABLE);
@@ -382,7 +383,7 @@ public class CppLinkActionTest extends BuildViewTestCase {
builder.setLinkType(
attributes.contains(StaticKeyAttributes.OUTPUT_FILE)
? LinkTargetType.STATIC_LIBRARY
- : LinkTargetType.DYNAMIC_LIBRARY);
+ : LinkTargetType.NODEPS_DYNAMIC_LIBRARY);
builder.setLibraryIdentifier("foo");
return builder.build();
}
@@ -412,7 +413,7 @@ public class CppLinkActionTest extends BuildViewTestCase {
builder.setLinkType(LinkTargetType.STATIC_LIBRARY);
assertThat(builder.canSplitCommandLine()).isTrue();
- builder.setLinkType(LinkTargetType.DYNAMIC_LIBRARY);
+ builder.setLinkType(LinkTargetType.NODEPS_DYNAMIC_LIBRARY);
assertThat(builder.canSplitCommandLine()).isTrue();
builder.setInterfaceOutput(outputIfso);
@@ -567,7 +568,7 @@ public class CppLinkActionTest extends BuildViewTestCase {
"feature {",
" name: 'build_interface_libraries'",
" flag_set {",
- " action: '" + LinkTargetType.DYNAMIC_LIBRARY.getActionName() + "',",
+ " action: '" + LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName() + "',",
" flag_group {",
" flag: '%{generate_interface_library}'",
" flag: '%{interface_library_builder_path}'",
@@ -579,7 +580,7 @@ public class CppLinkActionTest extends BuildViewTestCase {
"feature {",
" name: 'dynamic_library_linker_tool'",
" flag_set {",
- " action: 'c++-link-dynamic-library'",
+ " action: 'c++-link-nodeps-dynamic-library'",
" flag_group {",
" flag: 'dynamic_library_linker_tool'",
" }",
@@ -589,8 +590,8 @@ public class CppLinkActionTest extends BuildViewTestCase {
" name: 'has_configured_linker_path'",
"}",
"action_config {",
- " config_name: '" + LinkTargetType.DYNAMIC_LIBRARY.getActionName() + "'",
- " action_name: '" + LinkTargetType.DYNAMIC_LIBRARY.getActionName() + "'",
+ " config_name: '" + LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName() + "'",
+ " action_name: '" + LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName() + "'",
" tool {",
" tool_path: 'custom/crosstool/scripts/link_dynamic_library.sh'",
" }",
@@ -602,10 +603,10 @@ public class CppLinkActionTest extends BuildViewTestCase {
ImmutableSet.of(
"build_interface_libraries",
"dynamic_library_linker_tool",
- LinkTargetType.DYNAMIC_LIBRARY.getActionName()));
+ LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName()));
CppLinkActionBuilder builder =
createLinkBuilder(
- LinkTargetType.DYNAMIC_LIBRARY,
+ LinkTargetType.NODEPS_DYNAMIC_LIBRARY,
"foo.so",
ImmutableList.<Artifact>of(),
ImmutableList.<LibraryToLink>of(),