[PATCH] D143540: [llvm-lib] Use COFF archive format in llvm-lib (other archive tools don't use this format).

Jacek Caban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 17:04:29 PDT 2023


jacek added inline comments.


================
Comment at: llvm/lib/Object/ArchiveWriter.cpp:769
+  // COFF symbol map uses 16-bit indexes, so we can't use it if there are too
+  // many members.
+  if (isCOFFArchive(Kind) && NewMembers.size() > 0xfffe)
----------------
efriedma wrote:
> jacek wrote:
> > efriedma wrote:
> > > I'm curious, what does MSVC lib do here?  Refuse to construct the archive?  Skip creating the symbol table? Use some other output format?
> > According to my testing, it has a limit of 4090 object files. When I try to pass more, I get an ambiguous error:
> > $ lib -out:test.lib -nologo @inputs/files.txt
> > LINK : fatal error LNK1104: cannot open file 'inputs\a4091.obj'
> That's strange... maybe accidentally running into the C library's file handle limit.  What happens if you try adding additional files to a library that already contains 4090 object files?
Oh, right, I can get larger libraries this way. I can get up to 65535 object files by merging multiple libraries until I get an error:

LINK : fatal error LNK1189: library limit of 65535 objects exceeded


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143540/new/

https://reviews.llvm.org/D143540



More information about the llvm-commits mailing list