summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gccld/gccld.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-08 05:17:40 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-08 05:17:40 +0000
commit359df30f3d3b040a4bfc32a97b972a142df71ca8 (patch)
tree6d3fee5ba8e67d4103dc694b4ea47727377337cd /llvm/tools/gccld/gccld.cpp
parent8f59e90cef6e8ae4720e076fa2fc583cf9719797 (diff)
downloadbcm5719-llvm-359df30f3d3b040a4bfc32a97b972a142df71ca8.tar.gz
bcm5719-llvm-359df30f3d3b040a4bfc32a97b972a142df71ca8.zip
When -link-as-library, add -l options to Module's deplibs
llvm-svn: 18617
Diffstat (limited to 'llvm/tools/gccld/gccld.cpp')
-rw-r--r--llvm/tools/gccld/gccld.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp
index 48fbd8b633d..d06eb6ec05f 100644
--- a/llvm/tools/gccld/gccld.cpp
+++ b/llvm/tools/gccld/gccld.cpp
@@ -176,10 +176,17 @@ int main(int argc, char **argv, char **envp) {
std::auto_ptr<Module> Composite(0);
if (LinkAsLibrary) {
- // Link in only the files, we ignore libraries in this case.
+ // Link in only the files.
Composite.reset( new Module(argv[0]) );
if (LinkFiles(argv[0], Composite.get(), InputFilenames, Verbose))
return 1; // Error already printed
+ // The libraries aren't linked in but are noted as "dependent" in the
+ // module.
+ for (cl::list<std::string>::const_iterator I = Libraries.begin(),
+ E = Libraries.end(); I != E ; ++I) {
+ Composite.get()->addLibrary(*I);
+ }
+
} else {
// Build a list of the items from our command line
LinkItemList Items;
OpenPOWER on IntegriCloud