diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-08 05:17:40 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-08 05:17:40 +0000 |
commit | 6b463b261e1eba8e5bfd14ccc81f6e747e8cd523 (patch) | |
tree | bfaafae20760fc90fa99772384bccac29de4d547 /tools/gccld | |
parent | 631845650793300e8f086e9c172711ede7c8cfdf (diff) | |
download | external_llvm-6b463b261e1eba8e5bfd14ccc81f6e747e8cd523.zip external_llvm-6b463b261e1eba8e5bfd14ccc81f6e747e8cd523.tar.gz external_llvm-6b463b261e1eba8e5bfd14ccc81f6e747e8cd523.tar.bz2 |
When -link-as-library, add -l options to Module's deplibs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18617 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld')
-rw-r--r-- | tools/gccld/gccld.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index 48fbd8b..d06eb6e 100644 --- a/tools/gccld/gccld.cpp +++ b/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; |