Fix component build

b11386f9be broke lld build
if `-DBUILD_SHARED_LIBS=ON` is passed to CMake.
This commit is contained in:
Rui Ueyama 2019-11-19 11:16:59 +09:00
parent 6ae7315746
commit d0371f4736
7 changed files with 25 additions and 25 deletions

View File

@ -223,8 +223,8 @@ bool Resolver::resolveUndefines() {
if (!file) if (!file)
return true; return true;
if (std::error_code ec = file->parse()) { if (std::error_code ec = file->parse()) {
lld::errs() << "Cannot open " + file->path() << ": " << ec.message() llvm::errs() << "Cannot open " + file->path() << ": " << ec.message()
<< "\n"; << "\n";
return false; return false;
} }
DEBUG_WITH_TYPE("resolver", DEBUG_WITH_TYPE("resolver",
@ -252,8 +252,8 @@ bool Resolver::resolveUndefines() {
if (auto EC = undefAddedOrError.takeError()) { if (auto EC = undefAddedOrError.takeError()) {
// FIXME: This should be passed to logAllUnhandledErrors but it needs // FIXME: This should be passed to logAllUnhandledErrors but it needs
// to be passed a Twine instead of a string. // to be passed a Twine instead of a string.
lld::errs() << "Error in " + file->path() << ": "; llvm::errs() << "Error in " + file->path() << ": ";
logAllUnhandledErrors(std::move(EC), lld::errs(), std::string()); logAllUnhandledErrors(std::move(EC), llvm::errs(), std::string());
return false; return false;
} }
undefAdded = undefAddedOrError.get(); undefAdded = undefAddedOrError.get();
@ -266,8 +266,8 @@ bool Resolver::resolveUndefines() {
if (auto EC = undefAddedOrError.takeError()) { if (auto EC = undefAddedOrError.takeError()) {
// FIXME: This should be passed to logAllUnhandledErrors but it needs // FIXME: This should be passed to logAllUnhandledErrors but it needs
// to be passed a Twine instead of a string. // to be passed a Twine instead of a string.
lld::errs() << "Error in " + file->path() << ": "; llvm::errs() << "Error in " + file->path() << ": ";
logAllUnhandledErrors(std::move(EC), lld::errs(), std::string()); logAllUnhandledErrors(std::move(EC), llvm::errs(), std::string());
return false; return false;
} }
undefAdded = undefAddedOrError.get(); undefAdded = undefAddedOrError.get();
@ -279,8 +279,8 @@ bool Resolver::resolveUndefines() {
if (auto EC = handleSharedLibrary(*file)) { if (auto EC = handleSharedLibrary(*file)) {
// FIXME: This should be passed to logAllUnhandledErrors but it needs // FIXME: This should be passed to logAllUnhandledErrors but it needs
// to be passed a Twine instead of a string. // to be passed a Twine instead of a string.
lld::errs() << "Error in " + file->path() << ": "; llvm::errs() << "Error in " + file->path() << ": ";
logAllUnhandledErrors(std::move(EC), lld::errs(), std::string()); logAllUnhandledErrors(std::move(EC), llvm::errs(), std::string());
return false; return false;
} }
break; break;
@ -424,14 +424,14 @@ bool Resolver::checkUndefines() {
// Seems like this symbol is undefined. Warn that. // Seems like this symbol is undefined. Warn that.
foundUndefines = true; foundUndefines = true;
if (_ctx.printRemainingUndefines()) { if (_ctx.printRemainingUndefines()) {
lld::errs() << "Undefined symbol: " << undef->file().path() << ": " llvm::errs() << "Undefined symbol: " << undef->file().path() << ": "
<< _ctx.demangle(undef->name()) << "\n"; << _ctx.demangle(undef->name()) << "\n";
} }
} }
if (!foundUndefines) if (!foundUndefines)
return false; return false;
if (_ctx.printRemainingUndefines()) if (_ctx.printRemainingUndefines())
lld::errs() << "symbol(s) not found\n"; llvm::errs() << "symbol(s) not found\n";
return true; return true;
} }

View File

@ -157,15 +157,15 @@ bool SymbolTable::addByName(const Atom &newAtom) {
useNew = true; useNew = true;
break; break;
} }
lld::errs() << "Size mismatch: " << existing->name() << " (" llvm::errs() << "Size mismatch: " << existing->name() << " ("
<< existingSize << ") " << newAtom.name() << " (" << newSize << existingSize << ") " << newAtom.name() << " (" << newSize
<< ")\n"; << ")\n";
LLVM_FALLTHROUGH; LLVM_FALLTHROUGH;
} }
case MCR_Error: case MCR_Error:
lld::errs() << "Duplicate symbols: " << existing->name() << ":" llvm::errs() << "Duplicate symbols: " << existing->name() << ":"
<< existing->file().path() << " and " << newAtom.name() << ":" << existing->file().path() << " and " << newAtom.name()
<< newAtom.file().path() << "\n"; << ":" << newAtom.file().path() << "\n";
llvm::report_fatal_error("duplicate symbol error"); llvm::report_fatal_error("duplicate symbol error");
break; break;
} }
@ -187,7 +187,7 @@ bool SymbolTable::addByName(const Atom &newAtom) {
break; break;
} }
case NCR_Error: case NCR_Error:
lld::errs() << "SymbolTable: error while merging " << name << "\n"; llvm::errs() << "SymbolTable: error while merging " << name << "\n";
llvm::report_fatal_error("duplicate symbol error"); llvm::report_fatal_error("duplicate symbol error");
break; break;
} }

View File

@ -232,7 +232,7 @@ static std::error_code parseOrderFile(StringRef orderFilePath,
sym = prefixAndSym.first; sym = prefixAndSym.first;
if (!sym.empty()) { if (!sym.empty()) {
ctx.appendOrderedSymbol(sym, prefix); ctx.appendOrderedSymbol(sym, prefix);
// lld::errs() << sym << ", prefix=" << prefix << "\n"; // llvm::errs() << sym << ", prefix=" << prefix << "\n";
} }
} }
return std::error_code(); return std::error_code();
@ -382,7 +382,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
!parsedArgs.getLastArg(OPT_test_file_usage)) { !parsedArgs.getLastArg(OPT_test_file_usage)) {
// If no -arch and no options at all, print usage message. // If no -arch and no options at all, print usage message.
if (parsedArgs.size() == 0) { if (parsedArgs.size() == 0) {
table.PrintHelp(lld::outs(), table.PrintHelp(llvm::outs(),
(std::string(args[0]) + " [options] file...").c_str(), (std::string(args[0]) + " [options] file...").c_str(),
"LLVM Linker", false); "LLVM Linker", false);
} else { } else {

View File

@ -145,7 +145,7 @@ private:
+ mb.getBufferIdentifier() + ")").str(); + mb.getBufferIdentifier() + ")").str();
if (_logLoading) if (_logLoading)
lld::errs() << memberPath << "\n"; llvm::errs() << memberPath << "\n";
std::unique_ptr<MemoryBuffer> memberMB(MemoryBuffer::getMemBuffer( std::unique_ptr<MemoryBuffer> memberMB(MemoryBuffer::getMemBuffer(
mb.getBuffer(), mb.getBufferIdentifier(), false)); mb.getBuffer(), mb.getBufferIdentifier(), false));

View File

@ -241,8 +241,8 @@ static bool compareAtomsSub(const LayoutPass::SortKey &lc,
return leftOrdinal < rightOrdinal; return leftOrdinal < rightOrdinal;
} }
lld::errs() << "Unordered: <" << left->name() << "> <" << right->name() llvm::errs() << "Unordered: <" << left->name() << "> <" << right->name()
<< ">\n"; << ">\n";
llvm_unreachable("Atoms with Same Ordinal!"); llvm_unreachable("Atoms with Same Ordinal!");
} }

View File

@ -825,7 +825,7 @@ bool MachOLinkingContext::sectionAligned(StringRef seg, StringRef sect,
void MachOLinkingContext::addExportSymbol(StringRef sym) { void MachOLinkingContext::addExportSymbol(StringRef sym) {
// Support old crufty export lists with bogus entries. // Support old crufty export lists with bogus entries.
if (sym.endswith(".eh") || sym.startswith(".objc_category_name_")) { if (sym.endswith(".eh") || sym.startswith(".objc_category_name_")) {
lld::errs() << "warning: ignoring " << sym << " in export list\n"; llvm::errs() << "warning: ignoring " << sym << " in export list\n";
return; return;
} }
// Only i386 MacOSX uses old ABI, so don't change those. // Only i386 MacOSX uses old ABI, so don't change those.

View File

@ -317,7 +317,7 @@ llvm::Error processSymboledSection(DefinedAtom::ContentType atomType,
// Debug logging of symbols. // Debug logging of symbols.
// for (const Symbol *sym : symbols) // for (const Symbol *sym : symbols)
// lld::errs() << " sym: " // llvm::errs() << " sym: "
// << llvm::format("0x%08llx ", (uint64_t)sym->value) // << llvm::format("0x%08llx ", (uint64_t)sym->value)
// << ", " << sym->name << "\n"; // << ", " << sym->name << "\n";