[PATCH] D31011: recommend using llvm-ar when finding undefined references and empty archives

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 17:10:06 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/InputFiles.h:253
 private:
+  static bool ArchiveWithoutSymbolsSeen;
   std::unique_ptr<Archive> File;
----------------
In this way, you need to reset the value in `main` because LLD should be able to be invoked more than once in the same process if it's used as a library. You want to store this boolean variable to `Config`.


================
Comment at: ELF/Relocations.cpp:619
+    if (ArchiveFile::archiveWithoutSymbolsSeen())
+      message("At least one archive listed no symbols in its index."
+              " This can happen when creating archives with a version"
----------------
You only want to print out this message only once, no?

(nit: remove trailing "\n". I believe message() automatically appends that.)


https://reviews.llvm.org/D31011





More information about the llvm-commits mailing list