summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkArchives.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-25 09:32:08 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-25 09:32:08 +0000
commit8bb258d1ea45ce688b94ad8ffba97914314a513a (patch)
tree9decbcee16facd99e1097912cb1514fdc4f16b4f /llvm/lib/Linker/LinkArchives.cpp
parent2c4f9a484c22aab24907bbef93350d67ae8395f6 (diff)
downloadbcm5719-llvm-8bb258d1ea45ce688b94ad8ffba97914314a513a.tar.gz
bcm5719-llvm-8bb258d1ea45ce688b94ad8ffba97914314a513a.zip
Implement dependent library linking. It is no longer required that -lstdc++
-lstdsup++ no -lc be passed on the command line to llvm linkers if the progam being linked was compiled with the C/C++ Front End or Stacker. llvm-svn: 18243
Diffstat (limited to 'llvm/lib/Linker/LinkArchives.cpp')
-rw-r--r--llvm/lib/Linker/LinkArchives.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Linker/LinkArchives.cpp b/llvm/lib/Linker/LinkArchives.cpp
index 0d770f56f13..1f96bf97c89 100644
--- a/llvm/lib/Linker/LinkArchives.cpp
+++ b/llvm/lib/Linker/LinkArchives.cpp
@@ -371,12 +371,19 @@ bool llvm::LinkFiles(const char *progname, Module *HeadModule,
/// TRUE - Error.
///
void llvm::LinkLibraries(const char *progname, Module *HeadModule,
- const std::vector<std::string> &Libraries,
+ const std::vector<std::string> &Libs,
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);
OpenPOWER on IntegriCloud