aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java5
1 files changed, 3 insertions, 2 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 c7ab4bb993..cad71852a3 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
@@ -488,7 +488,7 @@ public final class LinkCommandLine extends CommandLine {
return ImmutableList.copyOf(batchCommand);
}
}
-
+
private boolean isSharedNativeLibrary() {
return nativeDeps && cppConfiguration.shareNativeDeps();
}
@@ -587,7 +587,8 @@ public final class LinkCommandLine extends CommandLine {
CppModel.PREPROCESSOR_DEFINES_VARIABLE_NAME,
computeAllLinkstampDefines());
// For dynamic libraries, produce position independent code.
- if (linkTargetType == LinkTargetType.DYNAMIC_LIBRARY && ccProvider.toolchainNeedsPic()) {
+ if (cppConfiguration.forcePic()
+ || (linkTargetType == LinkTargetType.DYNAMIC_LIBRARY && ccProvider.toolchainNeedsPic())) {
linkstampVariables.addStringVariable(CppModel.PIC_VARIABLE_NAME, "");
}
return linkstampVariables.build();