diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java
index 74f7052..f6094fd 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java
@@ -876,15 +876,14 @@
 
     CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create();
     // TODO(b/111289526): Remove CcLinkingInfo provider from cc_binary as soon as the flag
-    // --experimental_enable_cc_dynlibs_for_runtime is flipped. An empty CcLinkParamsStore is not
+    // --noexperimental_enable_cc_dynlibs_for_runtime is flipped. An empty CcLinkParamsStore is not
     // needed, but here we set it to avoid a null pointer exception in places where we're expecting
     // it. In the future CcLinkParamsStore will be obligatory.
-    ccLinkingInfoBuilder.setCcLinkParamsStore(
-        new CcLinkParamsStore(
-            /* staticModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY,
-            /* staticModeParamsForExecutable= */ CcLinkParams.EMPTY,
-            /* dynamicModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY,
-            /* dynamicModeParamsForExecutable= */ CcLinkParams.EMPTY));
+    ccLinkingInfoBuilder
+        .setStaticModeParamsForDynamicLibrary(CcLinkParams.EMPTY)
+        .setStaticModeParamsForExecutable(CcLinkParams.EMPTY)
+        .setDynamicModeParamsForDynamicLibrary(CcLinkParams.EMPTY)
+        .setDynamicModeParamsForExecutable(CcLinkParams.EMPTY);
     if (cppConfiguration.enableCcDynamicLibrariesForRuntime()) {
       ccLinkingInfoBuilder.setCcDynamicLibrariesForRuntime(
           new CcDynamicLibrariesForRuntime(
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java
index ba6907f..b38b379 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java
@@ -55,6 +55,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.function.BiFunction;
 import javax.annotation.Nullable;
 
 /**
@@ -536,11 +537,45 @@
           collectDynamicLibrariesForRuntimeArtifacts(
               ccLinkingOutputs.getDynamicLibrariesForRuntime()));
     }
-    CppConfiguration cppConfiguration = ruleContext.getFragment(CppConfiguration.class);
-    boolean forcePic = cppConfiguration.forcePic();
-    ccLinkingInfoBuilder.setCcLinkParamsStore(
-        new CcLinkParamsStore(
-            createCcLinkParamsStore(ccLinkingOutputs, ccCompilationContext, forcePic)));
+
+    final CcLinkingOutputs ccLinkingOutputsFinalized = ccLinkingOutputs;
+    BiFunction<Boolean, Boolean, CcLinkParams> createParams =
+        (staticMode, forDynamicLibrary) -> {
+          CcLinkParams.Builder builder = CcLinkParams.builder();
+          builder.addLinkstamps(linkstamps.build(), ccCompilationContext);
+          for (CcLinkingInfo ccLinkingInfo : ccLinkingInfos) {
+            builder.addTransitiveArgs(
+                ccLinkingInfo.getCcLinkParams(
+                    /* staticMode= */ staticMode, /* forDynamicLibrary */ forDynamicLibrary));
+          }
+          if (!neverlink) {
+            builder.addLibraries(
+                ccLinkingOutputsFinalized.getPreferredLibraries(
+                    staticMode,
+                    /*preferPic=*/ forDynamicLibrary
+                        || ruleContext.getFragment(CppConfiguration.class).forcePic()));
+            if (!staticMode
+                || (ccLinkingOutputsFinalized.getStaticLibraries().isEmpty()
+                    && ccLinkingOutputsFinalized.getPicStaticLibraries().isEmpty())) {
+              builder.addDynamicLibrariesForRuntime(
+                  LinkerInputs.toLibraryArtifacts(
+                      ccLinkingOutputsFinalized.getDynamicLibrariesForRuntime()));
+            }
+            builder.addLinkOpts(linkopts);
+            builder.addNonCodeInputs(nonCodeLinkerInputs);
+          }
+          return builder.build();
+        };
+
+    ccLinkingInfoBuilder
+        .setStaticModeParamsForDynamicLibrary(
+            createParams.apply(/* staticMode= */ true, /* forDynamicLibrary= */ true))
+        .setStaticModeParamsForExecutable(
+            createParams.apply(/* staticMode= */ true, /* forDynamicLibrary= */ false))
+        .setDynamicModeParamsForDynamicLibrary(
+            createParams.apply(/* staticMode= */ false, /* forDynamicLibrary= */ true))
+        .setDynamicModeParamsForExecutable(
+            createParams.apply(/* staticMode= */ false, /* forDynamicLibrary= */ false));
     providers.put(ccLinkingInfoBuilder.build());
     return new LinkingInfo(
         providers.build(), outputGroups, ccLinkingOutputs, originalLinkingOutputs);
@@ -611,35 +646,6 @@
     outputGroups.put(DYNAMIC_LIBRARY_OUTPUT_GROUP_NAME, dynamicLibrary.build());
   }
 
-  private AbstractCcLinkParamsStore createCcLinkParamsStore(
-      final CcLinkingOutputs ccLinkingOutputs,
-      final CcCompilationContext ccCompilationContext,
-      final boolean forcePic) {
-    return new AbstractCcLinkParamsStore() {
-      @Override
-      protected void collect(
-          CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {
-        builder.addLinkstamps(linkstamps.build(), ccCompilationContext);
-        for (CcLinkingInfo ccLinkingInfo : ccLinkingInfos) {
-          builder.add(ccLinkingInfo.getCcLinkParamsStore());
-        }
-        if (!neverlink) {
-          builder.addLibraries(
-              ccLinkingOutputs.getPreferredLibraries(
-                  linkingStatically, /*preferPic=*/ linkShared || forcePic));
-          if (!linkingStatically
-              || (ccLinkingOutputs.getStaticLibraries().isEmpty()
-                  && ccLinkingOutputs.getPicStaticLibraries().isEmpty())) {
-            builder.addDynamicLibrariesForRuntime(
-                LinkerInputs.toLibraryArtifacts(ccLinkingOutputs.getDynamicLibrariesForRuntime()));
-          }
-          builder.addLinkOpts(linkopts);
-          builder.addNonCodeInputs(nonCodeLinkerInputs);
-        }
-      }
-    };
-  }
-
   private NestedSet<LinkerInput> collectNativeCcLibraries(CcLinkingOutputs ccLinkingOutputs) {
     NestedSetBuilder<LinkerInput> result = NestedSetBuilder.linkOrder();
     result.addAll(ccLinkingOutputs.getDynamicLibrariesForLinking());
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java
index cc14d75..f593a44 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java
@@ -30,7 +30,6 @@
 import com.google.devtools.build.lib.syntax.Runtime;
 import com.google.devtools.build.lib.syntax.SkylarkType;
 import java.util.Collection;
-import java.util.stream.Stream;
 import javax.annotation.Nullable;
 
 /** Wrapper for every C++ linking provider. */
@@ -96,12 +95,11 @@
             throw new EvalException(
                 loc, "Every CcLinkParams parameter must be passed to CcLinkingInfo.");
           }
-          ccLinkingInfoBuilder.setCcLinkParamsStore(
-              new CcLinkParamsStore(
-                  staticModeParamsForDynamicLibrary,
-                  staticModeParamsForExecutable,
-                  dynamicModeParamsForDynamicLibrary,
-                  dynamicModeParamsForExecutable));
+          ccLinkingInfoBuilder
+              .setStaticModeParamsForDynamicLibrary(staticModeParamsForDynamicLibrary)
+              .setStaticModeParamsForExecutable(staticModeParamsForExecutable)
+              .setDynamicModeParamsForDynamicLibrary(dynamicModeParamsForDynamicLibrary)
+              .setDynamicModeParamsForExecutable(dynamicModeParamsForExecutable);
           // TODO(plf): The CcDynamicLibrariesForRuntime provider can be removed perhaps. Do not
           // add to the API until we know for sure. The CcRunfiles provider is already in the API
           // at the time of this comment (cl/200184914). Perhaps it can be removed but Skylark rules
@@ -113,12 +111,10 @@
 
   public static final CcLinkingInfo EMPTY =
       CcLinkingInfo.Builder.create()
-          .setCcLinkParamsStore(
-              new CcLinkParamsStore(
-                  /* staticModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY,
-                  /* staticModeParamsForExecutable= */ CcLinkParams.EMPTY,
-                  /* dynamicModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY,
-                  /* dynamicModeParamsForExecutable= */ CcLinkParams.EMPTY))
+          .setStaticModeParamsForDynamicLibrary(CcLinkParams.EMPTY)
+          .setStaticModeParamsForExecutable(CcLinkParams.EMPTY)
+          .setDynamicModeParamsForDynamicLibrary(CcLinkParams.EMPTY)
+          .setDynamicModeParamsForExecutable(CcLinkParams.EMPTY)
           .build();
 
   private final CcLinkParamsStore ccLinkParamsStore;
@@ -165,13 +161,26 @@
   }
 
   public static CcLinkingInfo merge(Collection<CcLinkingInfo> ccLinkingInfos) {
-    CcLinkingInfo.Builder builder = new CcLinkingInfo.Builder();
-    builder.setCcLinkParamsStore(
-        CcLinkParamsStore.merge(
-            Stream.concat(Stream.of(CcLinkingInfo.EMPTY), ccLinkingInfos.stream())
-                .map(CcLinkingInfo::getCcLinkParamsStore)
-                .collect(ImmutableList.toImmutableList())));
-    return builder.build();
+    CcLinkParams.Builder staticModeParamsForDynamicLibraryBuilder = CcLinkParams.builder();
+    CcLinkParams.Builder staticModeParamsForExecutableBuilder = CcLinkParams.builder();
+    CcLinkParams.Builder dynamicModeParamsForDynamicLibraryBuilder = CcLinkParams.builder();
+    CcLinkParams.Builder dynamicModeParamsForExecutableBuilder = CcLinkParams.builder();
+    for (CcLinkingInfo ccLinkingInfo : ccLinkingInfos) {
+      staticModeParamsForDynamicLibraryBuilder.addTransitiveArgs(
+          ccLinkingInfo.getStaticModeParamsForDynamicLibrary());
+      staticModeParamsForExecutableBuilder.addTransitiveArgs(
+          ccLinkingInfo.getStaticModeParamsForExecutable());
+      dynamicModeParamsForDynamicLibraryBuilder.addTransitiveArgs(
+          ccLinkingInfo.getDynamicModeParamsForDynamicLibrary());
+      dynamicModeParamsForExecutableBuilder.addTransitiveArgs(
+          ccLinkingInfo.getDynamicModeParamsForExecutable());
+    }
+    return new CcLinkingInfo.Builder()
+        .setStaticModeParamsForDynamicLibrary(staticModeParamsForDynamicLibraryBuilder.build())
+        .setStaticModeParamsForExecutable(staticModeParamsForExecutableBuilder.build())
+        .setDynamicModeParamsForDynamicLibrary(dynamicModeParamsForDynamicLibraryBuilder.build())
+        .setDynamicModeParamsForExecutable(dynamicModeParamsForExecutableBuilder.build())
+        .build();
   }
 
   @Override
@@ -183,9 +192,24 @@
     return ccDynamicLibrariesForRuntime;
   }
 
+  public CcLinkParams getCcLinkParams(boolean staticMode, boolean forDynamicLibrary) {
+    if (staticMode) {
+      if (forDynamicLibrary) {
+        return getStaticModeParamsForDynamicLibrary();
+      } else {
+        return getStaticModeParamsForExecutable();
+      }
+    } else {
+      if (forDynamicLibrary) {
+        return getDynamicModeParamsForDynamicLibrary();
+      } else {
+        return getDynamicModeParamsForExecutable();
+      }
+    }
+  }
+
   /** A Builder for {@link CcLinkingInfo}. */
   public static class Builder {
-    CcLinkParamsStore ccLinkParamsStore;
     CcLinkParams staticModeParamsForDynamicLibrary;
     CcLinkParams staticModeParamsForExecutable;
     CcLinkParams dynamicModeParamsForDynamicLibrary;
@@ -197,19 +221,6 @@
       return new CcLinkingInfo.Builder();
     }
 
-    @Deprecated
-    // TODO(b/111781390): Use individual setters for each flavor of CcLinkParams. Not all call sites
-    // are being refactored at once. Work in progress.
-    public Builder setCcLinkParamsStore(CcLinkParamsStore ccLinkParamsStore) {
-      Preconditions.checkState(this.ccLinkParamsStore == null);
-      Preconditions.checkState(this.staticModeParamsForDynamicLibrary == null);
-      Preconditions.checkState(this.staticModeParamsForExecutable == null);
-      Preconditions.checkState(this.dynamicModeParamsForDynamicLibrary == null);
-      Preconditions.checkState(this.dynamicModeParamsForExecutable == null);
-      this.ccLinkParamsStore = ccLinkParamsStore;
-      return this;
-    }
-
     public Builder setCcRunfiles(CcRunfiles ccRunfiles) {
       Preconditions.checkState(this.ccRunfiles == null);
       this.ccRunfiles = ccRunfiles;
@@ -224,46 +235,40 @@
     }
 
     public Builder setStaticModeParamsForDynamicLibrary(CcLinkParams ccLinkParams) {
-      Preconditions.checkState(
-          this.staticModeParamsForDynamicLibrary == null && ccLinkParamsStore == null);
+      Preconditions.checkState(this.staticModeParamsForDynamicLibrary == null);
       this.staticModeParamsForDynamicLibrary = ccLinkParams;
       return this;
     }
 
     public Builder setStaticModeParamsForExecutable(CcLinkParams ccLinkParams) {
-      Preconditions.checkState(
-          this.staticModeParamsForExecutable == null && ccLinkParamsStore == null);
+      Preconditions.checkState(this.staticModeParamsForExecutable == null);
       this.staticModeParamsForExecutable = ccLinkParams;
       return this;
     }
 
     public Builder setDynamicModeParamsForDynamicLibrary(CcLinkParams ccLinkParams) {
-      Preconditions.checkState(
-          this.dynamicModeParamsForDynamicLibrary == null && ccLinkParamsStore == null);
+      Preconditions.checkState(this.dynamicModeParamsForDynamicLibrary == null);
       this.dynamicModeParamsForDynamicLibrary = ccLinkParams;
       return this;
     }
 
     public Builder setDynamicModeParamsForExecutable(CcLinkParams ccLinkParams) {
-      Preconditions.checkState(
-          this.dynamicModeParamsForExecutable == null && ccLinkParamsStore == null);
+      Preconditions.checkState(this.dynamicModeParamsForExecutable == null);
       this.dynamicModeParamsForExecutable = ccLinkParams;
       return this;
     }
 
     public CcLinkingInfo build() {
-      if (ccLinkParamsStore == null) {
-        Preconditions.checkNotNull(staticModeParamsForDynamicLibrary);
-        Preconditions.checkNotNull(staticModeParamsForExecutable);
-        Preconditions.checkNotNull(dynamicModeParamsForDynamicLibrary);
-        Preconditions.checkNotNull(dynamicModeParamsForExecutable);
-        ccLinkParamsStore =
-            new CcLinkParamsStore(
-                staticModeParamsForDynamicLibrary,
-                staticModeParamsForExecutable,
-                dynamicModeParamsForDynamicLibrary,
-                dynamicModeParamsForExecutable);
-      }
+      Preconditions.checkNotNull(staticModeParamsForDynamicLibrary);
+      Preconditions.checkNotNull(staticModeParamsForExecutable);
+      Preconditions.checkNotNull(dynamicModeParamsForDynamicLibrary);
+      Preconditions.checkNotNull(dynamicModeParamsForExecutable);
+      CcLinkParamsStore ccLinkParamsStore =
+          new CcLinkParamsStore(
+              staticModeParamsForDynamicLibrary,
+              staticModeParamsForExecutable,
+              dynamicModeParamsForDynamicLibrary,
+              dynamicModeParamsForExecutable);
       return new CcLinkingInfo(ccLinkParamsStore, ccRunfiles, ccDynamicLibrariesForRuntime);
     }
   }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
index 42741b5..ff8e381 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
@@ -15,6 +15,7 @@
 package com.google.devtools.build.lib.rules.objc;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 import com.google.devtools.build.lib.actions.Artifact;
 import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictException;
 import com.google.devtools.build.lib.analysis.ConfiguredTarget;
@@ -24,12 +25,16 @@
 import com.google.devtools.build.lib.analysis.test.InstrumentedFilesProvider;
 import com.google.devtools.build.lib.collect.nestedset.NestedSet;
 import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
+import com.google.devtools.build.lib.rules.cpp.ArtifactCategory;
 import com.google.devtools.build.lib.rules.cpp.CcCompilationContext;
 import com.google.devtools.build.lib.rules.cpp.CcCompilationInfo;
-import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParams;
 import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo;
+import com.google.devtools.build.lib.rules.cpp.LinkerInputs;
+import com.google.devtools.build.lib.rules.cpp.LinkerInputs.LibraryToLink;
 import com.google.devtools.build.lib.rules.objc.ObjcCommon.ResourceAttributes;
 import com.google.devtools.build.lib.syntax.Type;
+import com.google.devtools.build.lib.vfs.FileSystemUtils;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -105,9 +110,14 @@
     CcCompilationInfo.Builder ccCompilationInfoBuilder = CcCompilationInfo.Builder.create();
     ccCompilationInfoBuilder.setCcCompilationContext(ccCompilationContext);
 
-    CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create();
-    ccLinkingInfoBuilder.setCcLinkParamsStore(
-        new CcLinkParamsStore(new ObjcLibraryCcLinkParamsStore(common)));
+    CcLinkParams ccLinkParams = buildCcLinkParams(common);
+    CcLinkingInfo ccLinkingInfo =
+        CcLinkingInfo.Builder.create()
+            .setStaticModeParamsForDynamicLibrary(ccLinkParams)
+            .setStaticModeParamsForExecutable(ccLinkParams)
+            .setDynamicModeParamsForDynamicLibrary(ccLinkParams)
+            .setDynamicModeParamsForExecutable(ccLinkParams)
+            .build();
 
     return ObjcRuleClasses.ruleConfiguredTarget(ruleContext, filesToBuild.build())
         .addNativeDeclaredProvider(common.getObjcProvider())
@@ -117,11 +127,33 @@
         .addProvider(
             InstrumentedFilesProvider.class,
             compilationSupport.getInstrumentedFilesProvider(objectFilesCollector.build()))
-        .addNativeDeclaredProvider(ccLinkingInfoBuilder.build())
+        .addNativeDeclaredProvider(ccLinkingInfo)
         .addOutputGroups(outputGroupCollector)
         .build();
   }
 
+  public CcLinkParams buildCcLinkParams(ObjcCommon common) {
+    ImmutableSet.Builder<LibraryToLink> libraries = new ImmutableSet.Builder<>();
+    ObjcProvider objcProvider = common.getObjcProvider();
+    for (Artifact library : objcProvider.get(ObjcProvider.LIBRARY)) {
+      libraries.add(
+          LinkerInputs.opaqueLibraryToLink(
+              library,
+              ArtifactCategory.STATIC_LIBRARY,
+              FileSystemUtils.removeExtension(library.getRootRelativePathString())));
+    }
+    libraries.addAll(objcProvider.get(ObjcProvider.CC_LIBRARY));
+
+    CcLinkParams.Builder builder = CcLinkParams.builder();
+    builder.addLibraries(libraries.build());
+
+    for (SdkFramework sdkFramework : objcProvider.get(ObjcProvider.SDK_FRAMEWORK)) {
+      builder.addLinkOpts(ImmutableList.of("-framework", sdkFramework.getName()));
+    }
+
+    return builder.build();
+  }
+
   /** Throws errors or warnings for bad attribute state. */
   private static void validateAttributes(RuleContext ruleContext) {
     for (String copt : ObjcCommon.getNonCrosstoolCopts(ruleContext)) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryCcLinkParamsStore.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryCcLinkParamsStore.java
deleted file mode 100644
index a97ba84..0000000
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryCcLinkParamsStore.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2016 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//    http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.lib.rules.objc;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.devtools.build.lib.actions.Artifact;
-import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore;
-import com.google.devtools.build.lib.rules.cpp.ArtifactCategory;
-import com.google.devtools.build.lib.rules.cpp.CcLinkParams;
-import com.google.devtools.build.lib.rules.cpp.LinkerInputs;
-import com.google.devtools.build.lib.rules.cpp.LinkerInputs.LibraryToLink;
-import com.google.devtools.build.lib.vfs.FileSystemUtils;
-
-/**
- * A {@link AbstractCcLinkParamsStore} to be propagated to dependent cc_{library, binary} targets.
- */
-class ObjcLibraryCcLinkParamsStore extends AbstractCcLinkParamsStore {
-
-  private final ObjcCommon common;
-
-  /**
-   * Create a params store.
-   * 
-   * @param common the {@link ObjcCommon} instance for this target.
-   */
-  public ObjcLibraryCcLinkParamsStore(ObjcCommon common) {
-    this.common = common;
-  }
-
-  @Override
-  protected void collect(
-      CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {
-    ObjcProvider objcProvider = common.getObjcProvider();
-
-    ImmutableSet.Builder<LibraryToLink> libraries = new ImmutableSet.Builder<>();
-    for (Artifact library : objcProvider.get(ObjcProvider.LIBRARY)) {
-      libraries.add(LinkerInputs.opaqueLibraryToLink(
-          library, ArtifactCategory.STATIC_LIBRARY,
-          FileSystemUtils.removeExtension(library.getRootRelativePathString())));
-    }
-    libraries.addAll(objcProvider.get(ObjcProvider.CC_LIBRARY));
-    builder.addLibraries(libraries.build());
-
-    for (SdkFramework sdkFramework : objcProvider.get(ObjcProvider.SDK_FRAMEWORK)) {
-      builder.addLinkOpts(ImmutableList.of("-framework", sdkFramework.getName()));
-    }
-  }
-}
\ No newline at end of file
