[lld] r282916 - Remove an warning message that can be spammy.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 12:59:26 PDT 2016


Author: ruiu
Date: Fri Sep 30 14:59:25 2016
New Revision: 282916

URL: http://llvm.org/viewvc/llvm-project?rev=282916&view=rev
Log:
Remove an warning message that can be spammy.

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.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=282916&r1=282915&r2=282916&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Fri Sep 30 14:59:25 2016
@@ -425,13 +425,6 @@ SymbolBody *elf::ObjectFile<ELFT>::creat
 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);




More information about the llvm-commits mailing list