summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/Linker.cpp
diff options
context:
space:
mode:
authorIvan Krasin <krasin@chromium.org>2011-09-20 22:52:35 +0000
committerIvan Krasin <krasin@chromium.org>2011-09-20 22:52:35 +0000
commit5227ea6028371f6d8538680fef1a79b49eb87f76 (patch)
tree42e2d2eb2b056362ead672b5898fb36b945dea26 /llvm/lib/Linker/Linker.cpp
parent6422e95c6673b647c65e99ef8a8707092e9116e4 (diff)
downloadbcm5719-llvm-5227ea6028371f6d8538680fef1a79b49eb87f76.tar.gz
bcm5719-llvm-5227ea6028371f6d8538680fef1a79b49eb87f76.zip
lib/Linker: add support of deps which does not end with ".so".
It happens (for example) when you want to have a dependency on the .so with the specific version, like liblzma.so.1.0.0 or libcrypto.so.0.9.8. llvm-svn: 140201
Diffstat (limited to 'llvm/lib/Linker/Linker.cpp')
-rw-r--r--llvm/lib/Linker/Linker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Linker/Linker.cpp b/llvm/lib/Linker/Linker.cpp
index fba91da5ddd..59fbceb6a30 100644
--- a/llvm/lib/Linker/Linker.cpp
+++ b/llvm/lib/Linker/Linker.cpp
@@ -141,6 +141,14 @@ static inline sys::Path IsLibrary(StringRef Name,
if (FullPath.isBitcodeFile()) // .so file containing bitcode?
return FullPath;
+ // Try libX form, to make it possible to add dependency on the
+ // specific version of .so, like liblzma.so.1.0.0
+ FullPath.eraseSuffix();
+ if (FullPath.isDynamicLibrary()) // Native shared library?
+ return FullPath;
+ if (FullPath.isBitcodeFile()) // .so file containing bitcode?
+ return FullPath;
+
// Not found .. fall through
// Indicate that the library was not found in the directory.
OpenPOWER on IntegriCloud