[PATCH] D143540: [llvm-lib] Add support for writing COFF archives.

Jacek Caban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 07:29:20 PST 2023


jacek added a comment.

In D143540#4114719 <https://reviews.llvm.org/D143540#4114719>, @mstorsjo wrote:

> Yeah we shouldn't make such differences based on the host where the tool is running. There's some predecent for autodetecting the mode based on other context (preexisting archive or archive members, or maybe also objects passed on the command line), which mostly should avoid the cross compilation issues. See https://github.com/llvm/llvm-project/commit/a0d42c86dbcb150c2a7a3d8f2a8500dcfb98a5d1 for the original implementation of that (I believe it has evolved a bit still through the years since).

Interesting. Actually, that change was broken around K_COFF handling. If you try to modify an archive recognized as K_COFF, it would hit llvm_unreachable in isBSDLike when trying to write an archive. I verified that it's fixed by this patch series and llvm-ar writes K_COFF archive.


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

https://reviews.llvm.org/D143540



More information about the llvm-commits mailing list