aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java
diff options
context:
space:
mode:
authorGravatar Cal Peyser <cpeyser@google.com>2016-08-11 20:04:57 +0000
committerGravatar Yue Gan <yueg@google.com>2016-08-12 08:52:51 +0000
commit7e33704e7546bb676e9052089c30f1dd625fd082 (patch)
treea078ba5aed70f69ccbbb6d0ea42453737ebcdd5d /src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java
parent2427f8d056d143fd3ef3f8b36ffb56cf498d64bc (diff)
Implement objc archiving in the crosstool. This involves a few steps:
1) In ExperimentalObjcLibrary, if static linking is required, signal CcLibraryHelper to create a static link action and pass in the necessary variables/link action input. 2) Add a new link type (Link.LinkTargetType.OBJC_STATIC_LIBRARY). This involves changes to Link and LinkCommandLine. 3) For this new link type, implement static linking the OSX CROSSTOOL. Also add tools in the crosstool package that point at libtool, which performs the archiving. -- MOS_MIGRATED_REVID=130022410
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java
index 7b5f693dc5..32e2b7b1a1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java
@@ -35,6 +35,19 @@ import java.util.Iterator;
*/
public abstract class Link {
+ /**
+ * Categories of link action that must be defined with action_configs in any toolchain.
+ */
+ static final Iterable<LinkTargetType> MANDATORY_LINK_TARGET_TYPES =
+ ImmutableList.of(
+ LinkTargetType.STATIC_LIBRARY,
+ LinkTargetType.PIC_STATIC_LIBRARY,
+ LinkTargetType.ALWAYS_LINK_STATIC_LIBRARY,
+ LinkTargetType.ALWAYS_LINK_PIC_STATIC_LIBRARY,
+ LinkTargetType.DYNAMIC_LIBRARY,
+ LinkTargetType.EXECUTABLE,
+ LinkTargetType.INTERFACE_DYNAMIC_LIBRARY);
+
private Link() {} // uninstantiable
/**
@@ -107,6 +120,14 @@ public abstract class Link {
"c++-link-static-library",
Picness.NOPIC,
ArtifactCategory.STATIC_LIBRARY),
+
+ /** An objc static archive. */
+ OBJC_ARCHIVE(
+ ".a",
+ Staticness.STATIC,
+ "objc-archive",
+ Picness.NOPIC,
+ ArtifactCategory.STATIC_LIBRARY),
/** A static archive with .pic.o object files (compiled with -fPIC). */
PIC_STATIC_LIBRARY(