[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 16:23:50 PDT 2017


ruiu added a comment.

I think this patch changes too many files. You could simplify this by constructing an error message string in `ArchiveFile::parse` (to briefly say something like that "foo.a: no symbol table found. If you are attempting LTO, you need to use llvm-ar instead of ar to create static archives.") and store that to Config. So the code to add `parse` would be something like

  Config->EmptyArchiveErrors.push_back(toString(*this) + ":  symbol table missing ...");

where Config->EmptyArchiveErrors is of std::vector<std::string>.

And then print out these messages in `reportUndefined`.


https://reviews.llvm.org/D31011





More information about the llvm-commits mailing list