aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2018-03-21 07:00:35 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-21 07:02:30 -0700
commit67549a752c2316234b19d7b50ea84a8ae80d3669 (patch)
tree563d8d00732e5988d339cc633d8ddf78c7167a0f /src/main/java/com/google/devtools
parenta1068c44a700ec2cff84cbd12592e9bfea25d754 (diff)
Automated rollback of commit 3c5a1098af0c5ae80d4e3b1fc52dd1fef6027d43.
*** Reason for rollback *** Breaks bazel ci: https://github.com/bazelbuild/bazel/issues/4894#event-1533040075 *** Original change description *** Add crosstool_lib.bzl and crosstool_utils.bzl These will be used to rewrite current crosstool autoconfiguration into action_configs and features. RELNOTES: None. PiperOrigin-RevId: 189901308
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
index a2da30d674..b25dc7fc85 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
@@ -50,7 +50,6 @@ import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables;
import com.google.devtools.build.lib.rules.cpp.CppConfiguration.DynamicMode;
import com.google.devtools.build.lib.rules.cpp.CppConfiguration.HeadersCheckingMode;
import com.google.devtools.build.lib.rules.cpp.FdoSupport.FdoMode;
-import com.google.devtools.build.lib.rules.cpp.Link.LinkTargetType;
import com.google.devtools.build.lib.shell.ShellUtils;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization;
@@ -106,8 +105,11 @@ public final class CcCommon {
}
};
- public static final ImmutableSet<String> ALL_COMPILE_ACTIONS =
+ /** Action configs we request to enable. */
+ private static final ImmutableSet<String> DEFAULT_ACTION_CONFIGS =
ImmutableSet.of(
+ CppCompileAction.CC_FLAGS_MAKE_VARIABLE_ACTION_NAME,
+ CppCompileAction.STRIP_ACTION_NAME,
CppCompileAction.C_COMPILE,
CppCompileAction.CPP_COMPILE,
CppCompileAction.CPP_HEADER_PARSING,
@@ -118,29 +120,16 @@ public final class CcCommon {
CppCompileAction.PREPROCESS_ASSEMBLE,
CppCompileAction.CLIF_MATCH,
CppCompileAction.LINKSTAMP_COMPILE,
- CppCompileAction.CC_FLAGS_MAKE_VARIABLE_ACTION_NAME);
-
- public static final ImmutableSet<String> ALL_LINK_ACTIONS =
- ImmutableSet.of(
+ Link.LinkTargetType.STATIC_LIBRARY.getActionName(),
+ // We need to create pic-specific actions for link actions, as they will produce
+ // differently named outputs.
+ Link.LinkTargetType.PIC_STATIC_LIBRARY.getActionName(),
Link.LinkTargetType.INTERFACE_DYNAMIC_LIBRARY.getActionName(),
- Link.LinkTargetType.DYNAMIC_LIBRARY.getActionName(),
Link.LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName(),
- LinkTargetType.EXECUTABLE.getActionName());
-
- public static final ImmutableSet<String> ALL_ARCHIVE_ACTIONS =
- ImmutableSet.of(Link.LinkTargetType.STATIC_LIBRARY.getActionName());
-
- public static final ImmutableSet<String> ALL_OTHER_ACTIONS =
- ImmutableSet.of(CppCompileAction.STRIP_ACTION_NAME);
-
- /** Action configs we request to enable. */
- public static final ImmutableSet<String> DEFAULT_ACTION_CONFIGS =
- ImmutableSet.<String>builder()
- .addAll(ALL_COMPILE_ACTIONS)
- .addAll(ALL_LINK_ACTIONS)
- .addAll(ALL_ARCHIVE_ACTIONS)
- .addAll(ALL_OTHER_ACTIONS)
- .build();
+ Link.LinkTargetType.DYNAMIC_LIBRARY.getActionName(),
+ Link.LinkTargetType.ALWAYS_LINK_STATIC_LIBRARY.getActionName(),
+ Link.LinkTargetType.ALWAYS_LINK_PIC_STATIC_LIBRARY.getActionName(),
+ Link.LinkTargetType.EXECUTABLE.getActionName());
/** Features we request to enable unless a rule explicitly doesn't support them. */
private static final ImmutableSet<String> DEFAULT_FEATURES =
@@ -153,7 +142,6 @@ public final class CcCommon {
CppRuleClasses.INCLUDE_PATHS,
CppRuleClasses.PIC,
CppRuleClasses.PREPROCESSOR_DEFINES);
-
public static final String CC_TOOLCHAIN_DEFAULT_ATTRIBUTE_NAME = ":cc_toolchain";
/** C++ configuration */