From 6bf81ffdc8a7dba606c2358ae70e237eab0e280b Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Sun, 22 Sep 2024 16:03:02 -0400 Subject: [PATCH] Disable stdcall fixup warnings (x86 only) This warning is new in Binutils 2.42, and it regards fixing a long-time, x86 bfd bug. Previously the fixup did not occur and bfd would fail to locate decorated symbols. In the case of an entry point, bfd silently linked the wrong address! It remains silent if the entry point is not found, but the fixup makes it more likely to find the symbol. The old, buggy behavior was an accident. It differs from MSVC and nobody wants it. Theoretically some program might depend on the old behavior, hence the warning, but it's incredibly unlikely, so silence the warning. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index e6ab8ae..f4cae78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,6 +67,7 @@ ARG ARCH=x86_64-w64-mingw32 WORKDIR /binutils-$BINUTILS_VERSION COPY src/binutils-*.patch $PREFIX/src/ RUN sed -ri 's/(static bool insert_timestamp = )/\1!/' ld/emultempl/pe*.em \ + && sed -ri 's/(int pe_enable_stdcall_fixup = )/\1!!/' ld/emultempl/pe*.em \ && cat $PREFIX/src/binutils-*.patch | patch -p1 WORKDIR /x-binutils RUN /binutils-$BINUTILS_VERSION/configure \