Remove an warning message that can be spammy.
authorRui Ueyama <ruiu@google.com>
Fri, 30 Sep 2016 19:59:25 +0000 (19:59 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 30 Sep 2016 19:59:25 +0000 (19:59 +0000)
This was intended to warn on a usage error of an ar command.
I was thinking that false positive would be rare because it
has two guards: it warns only when an archive file has no symbols
and contains at least one file.

Turned out that false positive would probably be not that rare.
You wouldn't intentionally create an object file that contains no
exported symbols, but with conditional compile guards, you could
create such file. If it is for a LTO build, you could create an
archive file containing such file. That means there's no way to
detect the usage error in a reliable manner.

This patch simply removes the warning.

llvm-svn: 282916

lld/ELF/InputFiles.cpp

index c1b59c1..094ac0f 100644 (file)
@@ -425,13 +425,6 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
 template <class ELFT> void ArchiveFile::parse() {
   File = check(Archive::create(MB), "failed to parse archive");
 
-  // Checks for a common usage error of an ar command.
-  if (File->getNumberOfSymbols() == 0 && !File->isEmpty())
-    warn(getName() + " has no symbol."
-         " Chances are you are doing an LTO build and forgot to use an ar"
-         " command that can create a symbol table for LLVM bitcode files."
-         " If so, use llvm-ar or GNU ar + plugin.");
-
   // Read the symbol table to construct Lazy objects.
   for (const Archive::Symbol &Sym : File->symbols())
     Symtab<ELFT>::X->addLazyArchive(this, Sym);