diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java index bb3cdbdb79..82d2e26bc7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java @@ -397,18 +397,6 @@ public final class LinkCommandLine extends CommandLine { .build())); break; - case DYNAMIC_LIBRARY: - argv.add(toolPath); - argv.addAll( - featureConfiguration.getCommandLine( - actionName, - new Variables.Builder() - .addAll(variables) - .addStringSequenceVariable( - CppLinkActionBuilder.LEGACY_LINK_FLAGS_VARIABLE, getToolchainFlags()) - .build())); - break; - case STATIC_LIBRARY: case PIC_STATIC_LIBRARY: case ALWAYS_LINK_STATIC_LIBRARY: @@ -421,14 +409,23 @@ public final class LinkCommandLine extends CommandLine { argv.addAll(featureConfiguration.getCommandLine(actionName, variables)); break; - // Since the objc case is not hardcoded in CppConfiguration, we can use the actual tool. - // TODO(b/30109612): make this pattern the case for all link variants. + // Since the objc case/dynamic libs is not hardcoded in CppConfiguration, we can use the + // actual tool. + // TODO(b/30109612): make this pattern the case for all link variants. + case DYNAMIC_LIBRARY: case OBJC_ARCHIVE: case OBJC_FULLY_LINKED_ARCHIVE: case OBJC_EXECUTABLE: case OBJCPP_EXECUTABLE: argv.add(toolPath); - argv.addAll(featureConfiguration.getCommandLine(actionName, variables)); + argv.addAll( + featureConfiguration.getCommandLine( + actionName, + new Variables.Builder() + .addAll(variables) + .addStringSequenceVariable( + CppLinkActionBuilder.LEGACY_LINK_FLAGS_VARIABLE, getToolchainFlags()) + .build())); break; default: |