Add support for ".so" files compiled with LLVM which contain LLVM bytecode.

llvm-svn: 20253
This commit is contained in:
Chris Lattner 2005-02-19 18:30:29 +00:00
parent fe723a7c05
commit e68dae0eb6
2 changed files with 11 additions and 3 deletions

View File

@ -27,9 +27,15 @@ Linker::LinkInLibrary(const std::string& Lib)
// If its an archive, try to link it in // If its an archive, try to link it in
if (Pathname.isArchive()) { if (Pathname.isArchive()) {
if (LinkInArchive(Pathname)) { if (LinkInArchive(Pathname))
return error("Cannot link archive '" + Pathname.toString() + "'"); return error("Cannot link archive '" + Pathname.toString() + "'");
} } else if (Pathname.isBytecodeFile()) {
// LLVM ".so" file.
if (LinkInFile(Pathname))
return error("Cannot link file '" + Pathname.toString() + "'");
} else if (Pathname.isDynamicLibrary()) {
return warning("Library '" + Lib + "' is a native dynamic library.");
} else { } else {
return warning("Supposed library '" + Lib + "' isn't a library."); return warning("Supposed library '" + Lib + "' isn't a library.");
} }

View File

@ -133,7 +133,9 @@ static inline sys::Path IsLibrary(const std::string& Name,
FullPath.elideSuffix(); FullPath.elideSuffix();
FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1])); FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
if (FullPath.isDynamicLibrary()) if (FullPath.isDynamicLibrary()) // Native shared library?
return FullPath;
if (FullPath.isBytecodeFile()) // .so file containing bytecode?
return FullPath; return FullPath;
FullPath.clear(); FullPath.clear();