Possible bug in binutils for MinGW-w64 related to linking weak symbols
Johannes Khoshnazar-Thoma
johannes@johannesthoma.com
Thu Mar 19 14:09:07 GMT 2026
Hi Eric,
Am 19.03.26 um 14:54 schrieb Jan Beulich:
> On 19.03.2026 14:48, Eric Botcazou wrote:
>>> We had that discussion on the mingw list already, but in my opinion
>>> both foo and bar are properly defined, so not being able to link foo
>>> looks like a bug to me. It works with clang/llvm.
>> __attribute__((weak))__ is a GNU extension so the GNU toolchain is the de
>> facto reference implementation for it. Requiring that the attribute be used
>> consistently on all the declarations seems fairly reasonable to me.
True, but it works differently on the mingw-w64 target than on all others.
On a Linux target, the code compiles and links without problems. IMHO it shouldn't
change the semantics of __attribute__((weak))__ depending on target architecture. - Johannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20260319/2439a42b/attachment.htm>
More information about the Binutils
mailing list