Revert version 1.39. It breaks the ordering of the library processing.
[oota-llvm.git] / lib / Linker / LinkArchives.cpp
index 1f96bf97c89ab045c28e0560c6deb2d3b572fa79..af17ff31b884f3fdb6dc09e08c04a7694d5885f4 100644 (file)
@@ -60,8 +60,8 @@ std::string llvm::FindLib(const std::string &Filename,
     if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".bc"))
       return Directory + LibName + ".bc";
 
-    if (FileOpenable(Directory + LibName + SHLIBEXT))
-      return Directory + LibName + SHLIBEXT;
+    if (FileOpenable(Directory + LibName + LTDL_SHLIB_EXT))
+      return Directory + LibName + LTDL_SHLIB_EXT;
 
     if (!SharedObjectOnly && FileOpenable(Directory + LibName + ".a"))
       return Directory + LibName + ".a";
@@ -371,19 +371,12 @@ bool llvm::LinkFiles(const char *progname, Module *HeadModule,
 ///  TRUE  - Error.
 ///
 void llvm::LinkLibraries(const char *progname, Module *HeadModule,
-                         const std::vector<std::string> &Libs,
+                         const std::vector<std::string> &Libraries,
                          const std::vector<std::string> &LibPaths,
                          bool Verbose, bool Native) {
   // String in which to receive error messages.
   std::string ErrorMessage;
 
-  // Build a set of library names that we should try, including the 
-  // HeadModule's dependent libraries. We use a set here to eliminate 
-  // duplicates between the module's libraries and the argument Libs.
-  Module::LibraryListType Libraries(HeadModule->getLibraries());
-  Libraries.insert(Libs.begin(),Libs.end());
-
-  // For each library
   for (unsigned i = 0; i < Libraries.size(); ++i) {
     // Determine where this library lives.
     std::string Pathname = FindLib(Libraries[i], LibPaths);