[llvm] [llvm-ar] Use COFF archive format for COFF targets. (PR #82642)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 02:59:02 PST 2024


bd1976bris wrote:

> In theory, the behavior difference between llvm-ar and native "ar" could cause issues in edge cases. In practice, I've never heard of it causing anyone issues. Build systems generally don't create empty archives, or stick random files into archives. And even if they do, it only matters if you try to mix llvm-ar with a non-LLVM native archiver/linker; lld can parse any archive format.

Yes. I think for the reasons you mentioned this is isn't particularly important. It would be nice for the behavior make sense as far as possible though. In offline conversation @jh7370 noted the following:
```
Original behaviour of using the host comes from 9 years ago in a change by Rafael: https://github.com/llvm/llvm-project/commit/2535ea0b836bc3f1fd48d420f3611d1f97ad461d, and has just been incrementally been built on.
Commit message has no justification why using the host rather than e.g. the default triple (if it even existed in 2015) would be the right thing to do.
```
So, I just think that no one has noticed this up to now and we could change this behaviour.

https://github.com/llvm/llvm-project/pull/82642


More information about the llvm-commits mailing list