Changes in directory llvm/tools/gccld:

gccld.cpp updated: 1.107 -> 1.108
---
Log message:

For PR521: http://llvm.cs.uiuc.edu/PR521 :
With these patches we implement the ability for the Linker library to 
keep track of which libraries were actually bytecode files (not archives)
and cause their users to remove such files from the list of libraries to
pass to the native linker.


---
Diffs of the changes:  (+13 -1)

 gccld.cpp |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletion(-)


Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.107 llvm/tools/gccld/gccld.cpp:1.108
--- llvm/tools/gccld/gccld.cpp:1.107    Wed Dec 21 19:50:56 2005
+++ llvm/tools/gccld/gccld.cpp  Mon Jan  9 21:14:40 2006
@@ -243,11 +243,23 @@
     } else {
       // Build a list of the items from our command line
       Linker::ItemList Items;
+      Linker::ItemList NativeItems;
       BuildLinkItems(Items, InputFilenames, Libraries);
 
       // Link all the items together
-      if (TheLinker.LinkInItems(Items))
+      if (TheLinker.LinkInItems(Items,NativeItems))
         return 1; // Error already printed
+
+      // Revise the Libraries based on the remaining (native) libraries that
+      // were not linked in to the bytecode. This ensures that we don't attempt
+      // to pass a bytecode library to the native linker
+      Libraries.clear(); // we've consumed the libraries except for native
+      if ((Native || NativeCBE) && !NativeItems.empty()) {
+        for (Linker::ItemList::const_iterator I = NativeItems.begin(), 
+             E = NativeItems.end(); I != E; ++I) {
+          Libraries.push_back(I->first);
+        }
+      }
     }
 
     // We're done with the Linker, so tell it to release its module



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to