aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java3
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/MultiArchBinarySupport.java36
2 files changed, 30 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java
index 23ad482171..0f954a49eb 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java
@@ -158,7 +158,8 @@ public class AppleBinary implements RuleConfiguredTargetFactory {
ObjcProvider.Builder objcProviderBuilder = new ObjcProvider.Builder();
for (DependencySpecificConfiguration dependencySpecificConfiguration :
dependencySpecificConfigurations) {
- objcProviderBuilder.addTransitiveAndPropagate(dependencySpecificConfiguration.objcProvider());
+ objcProviderBuilder.addTransitiveAndPropagate(
+ dependencySpecificConfiguration.objcProviderWithDylibSymbols());
}
objcProviderBuilder.add(MULTI_ARCH_LINKED_BINARIES, outputArtifact);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/MultiArchBinarySupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/MultiArchBinarySupport.java
index a2cd8439ae..1b3d53f89e 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/MultiArchBinarySupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/MultiArchBinarySupport.java
@@ -68,22 +68,38 @@ public class MultiArchBinarySupport {
}
/**
- * Configuration, toolchain, and provider for for single-arch dependency configurations of a
- * multi-arch target.
+ * A tuple of values about dependency trees in a specific child configuration.
*/
@AutoValue
abstract static class DependencySpecificConfiguration {
static DependencySpecificConfiguration create(
- BuildConfiguration config, CcToolchainProvider toolchain, ObjcProvider objcProvider) {
+ BuildConfiguration config, CcToolchainProvider toolchain, ObjcProvider objcLinkProvider,
+ ObjcProvider objcPropagateProvider) {
return new AutoValue_MultiArchBinarySupport_DependencySpecificConfiguration(
- config, toolchain, objcProvider);
+ config, toolchain, objcLinkProvider, objcPropagateProvider);
}
+ /**
+ * Returns the child configuration for this tuple.
+ */
abstract BuildConfiguration config();
+ /**
+ * Returns the cc toolchain for this configuration.
+ */
abstract CcToolchainProvider toolchain();
- abstract ObjcProvider objcProvider();
+ /**
+ * Returns the {@link ObjcProvider} to use as input to the support controlling link actoins;
+ * dylib symbols should be subtracted from this provider.
+ */
+ abstract ObjcProvider objcLinkProvider();
+
+ /**
+ * Returns the {@link ObjcProvider} to propagate up to dependers; this will not have dylib
+ * symbols subtracted, thus signaling that this target is still responsible for those symbols.
+ */
+ abstract ObjcProvider objcProviderWithDylibSymbols();
}
@@ -149,7 +165,7 @@ public class MultiArchBinarySupport {
binariesToLipo.add(intermediateArtifacts.strippedSingleArchitectureBinary());
- ObjcProvider objcProvider = dependencySpecificConfiguration.objcProvider();
+ ObjcProvider objcProvider = dependencySpecificConfiguration.objcLinkProvider();
CompilationArtifacts compilationArtifacts =
CompilationSupport.compilationArtifacts(
ruleContext,
@@ -253,12 +269,16 @@ public class MultiArchBinarySupport {
nullToEmptyList(configToDepsCollectionMap.get(childConfig)),
nullToEmptyList(configurationToNonPropagatedObjcMap.get(childConfig)),
additionalDepProviders);
- ObjcProvider objcProvider = common.getObjcProvider().subtractSubtrees(dylibObjcProviders,
+ ObjcProvider objcProviderWithDylibSymbols = common.getObjcProvider();
+ ObjcProvider objcProvider = objcProviderWithDylibSymbols.subtractSubtrees(dylibObjcProviders,
ImmutableList.<CcLinkParamsProvider>of());
childInfoBuilder.add(
DependencySpecificConfiguration.create(
- childConfig, childConfigurationsAndToolchains.get(childConfig), objcProvider));
+ childConfig,
+ childConfigurationsAndToolchains.get(childConfig),
+ objcProvider,
+ objcProviderWithDylibSymbols));
}
return childInfoBuilder.build();