diff options
Diffstat (limited to 'lib/Linker/LinkItems.cpp')
-rw-r--r-- | lib/Linker/LinkItems.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp index 124e5e4e4d..c3e55976bc 100644 --- a/lib/Linker/LinkItems.cpp +++ b/lib/Linker/LinkItems.cpp @@ -51,6 +51,21 @@ Linker::LinkInItems(const ItemList& Items, ItemList& NativeItems) { } } + // @LOCALMOD-BEGIN + // At this point we have processed all the link items provided to us. Since + // we have an aggregated module at this point, the dependent libraries in + // that module should also be aggregated with duplicates eliminated. This is + // now the time to process the dependent libraries to resolve any remaining + // symbols. + bool is_native; + for (Module::lib_iterator I = Composite->lib_begin(), + E = Composite->lib_end(); I != E; ++I) { + if(LinkInLibrary(*I, is_native)) + return true; + if (is_native) + NativeItems.push_back(std::make_pair(*I, true)); + } + // @LOCALMOD-END return false; } @@ -113,7 +128,18 @@ bool Linker::LinkInLibraries(const std::vector<std::string> &Libraries) { for (unsigned i = 0; i < Libraries.size(); ++i) if (LinkInLibrary(Libraries[i], is_native)) return true; - + // @LOCALMOD-BEGIN + // At this point we have processed all the libraries provided to us. Since + // we have an aggregated module at this point, the dependent libraries in + // that module should also be aggregated with duplicates eliminated. This is + // now the time to process the dependent libraries to resolve any remaining + // symbols. + const Module::LibraryListType& DepLibs = Composite->getLibraries(); + for (Module::LibraryListType::const_iterator I = DepLibs.begin(), + E = DepLibs.end(); I != E; ++I) + if (LinkInLibrary(*I, is_native)) + return true; + // @LOCALMOD-END return false; } |