Add support for ".so" files compiled with LLVM which contain LLVM bytecode.
authorChris Lattner <sabre@nondot.org>
Sat, 19 Feb 2005 18:30:29 +0000 (18:30 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 19 Feb 2005 18:30:29 +0000 (18:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20253 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkLibraries.cpp
lib/Linker/Linker.cpp

index bfde7906bb11f9983b49719c63d80d96ff9dcc4c..eb31fb96da08f85e19a1cf8392c8f72a6b750431 100644 (file)
@@ -27,9 +27,15 @@ Linker::LinkInLibrary(const std::string& Lib)
 
   // If its an archive, try to link it in
   if (Pathname.isArchive()) {
-    if (LinkInArchive(Pathname)) {
+    if (LinkInArchive(Pathname))
       return error("Cannot link archive '" + Pathname.toString() + "'");
-    }
+  } else if (Pathname.isBytecodeFile()) {
+    // LLVM ".so" file.
+    if (LinkInFile(Pathname))
+      return error("Cannot link file '" + Pathname.toString() + "'");
+
+  } else if (Pathname.isDynamicLibrary()) {
+    return warning("Library '" + Lib + "' is a native dynamic library.");
   } else {
     return warning("Supposed library '" + Lib + "' isn't a library.");
   }
index ee34cee1d413a16c6b2f1da80ca70744003daa6f..19fd861c4dd9f8dab8b1241ce370b8841c2abe86 100644 (file)
@@ -133,7 +133,9 @@ static inline sys::Path IsLibrary(const std::string& Name,
 
   FullPath.elideSuffix();
   FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
-  if (FullPath.isDynamicLibrary())
+  if (FullPath.isDynamicLibrary())  // Native shared library?
+    return FullPath;
+  if (FullPath.isBytecodeFile())    // .so file containing bytecode?
     return FullPath;
 
   FullPath.clear();