diff options
author | 2016-12-16 10:21:57 +0000 | |
---|---|---|
committer | 2016-12-16 15:36:54 +0000 | |
commit | 52b34308428cfd117470c966d8df329f686fb9ed (patch) | |
tree | e7be0d9f510581655b72d8a93c0c81030b355627 | |
parent | 93f79bccffc05bb166f7f4a1a150611f83a5aae2 (diff) |
Rollback of commit 2d87bf1937c81ef84358fd5f6a372875f6c6fabf.
*** Reason for rollback ***
We have to roll back unknown commit, on which this one depends. Will resubmit after I fix the underlying issue.
*** Original change description ***
Support versioned shared library targets for cc_binary linkshared=1
This change allows versioned shared libraries (e.g. "libfoo.so.1.2") to be
built and linked.
--
PiperOrigin-RevId: 142240145
MOS_MIGRATED_REVID=142240145
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java | 4 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java | 6 |
2 files changed, 1 insertions, 9 deletions
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 1f2428f1da..1cb110aab1 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 @@ -192,9 +192,7 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory { } Artifact binary = ruleContext.getBinArtifact(binaryPath); - if (isLinkShared(ruleContext) - && !CppFileTypes.SHARED_LIBRARY.matches(binary.getFilename()) - && !CppFileTypes.VERSIONED_SHARED_LIBRARY.matches(binary.getFilename())) { + if (isLinkShared(ruleContext) && !CppFileTypes.SHARED_LIBRARY.matches(binary.getFilename())) { ruleContext.attributeError("linkshared", "'linkshared' used in non-shared library"); return null; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java index 2b0d081268..35f16bfbbc 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java @@ -1537,14 +1537,8 @@ public class CppLinkActionBuilder { String name = inputArtifact.getFilename(); boolean inputIsWholeArchive = !isRuntimeLinkerInput && needWholeArchive; if (CppFileTypes.SHARED_LIBRARY.matches(name)) { - // Use normal shared library resolution rules for shared libraries. String libName = name.replaceAll("(^lib|\\.(so|dylib)$)", ""); librariesToLink.addValue(new LibraryToLinkValue("-l" + libName, inputIsWholeArchive)); - } else if (CppFileTypes.VERSIONED_SHARED_LIBRARY.matches(name)) { - // Versioned shared libraries require the exact library filename, e.g.: - // -lfoo -> libfoo.so - // -l:libfoo.so.1 -> libfoo.so.1 - librariesToLink.addValue(new LibraryToLinkValue("-l:" + name, inputIsWholeArchive)); } else { // Interface shared objects have a non-standard extension // that the linker won't be able to find. So use the |