[PATCH] D148953: [llvm][ADT] Fix Any linker error with multiple compilers

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 02:09:45 PDT 2023


sebastian-ne added a comment.

For future reference, this patch was ported to mingw here: https://github.com/msys2/MINGW-packages/pull/16855

In D148953#4293674 <https://reviews.llvm.org/D148953#4293674>, @dblaikie wrote:

> In D148953#4291600 <https://reviews.llvm.org/D148953#4291600>, @sebastian-ne wrote:
>
>> Thanks for the quote from wikipedia!
>>
>>> Would this not be an ABI bug in those compilers that needs to be fixed there?
>>
>> One could stand on the point that if objects from different compilers are linked, the user needs to supply `-f[no-]zero-initialized-in-bss` to make sure they behave the same.
>> As this instance of such behavior is easy enough to fix in code, I think we can do that in LLVM.
>
> I don't think we should be working around ABI mismatches in compilers - the longer-term solution should be that we only use ABI compatible compilers, or use compilers in ABI-compatible ways (with the right flags, if that's what's required).
>
> What are the specifically incompatible compilers/versions/flags?

>From the ticket, it seems to be the mingw clang version and mingw gcc where the problem occurs.
At the time of writing this comment, mingw-w64-gcc is at version 12.2.0 and mingw-w64-clang is at 16.0.1.

> I don't think we should be working around ABI mismatches in compilers

Sure, I agree. The reason I still made this patch, is because it is only a one character change from a zero to a one :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148953



More information about the llvm-commits mailing list