Commit 682ef37
fix: pre-link libgcc_eh.a explicitly so its _Unwind_Resume wins over libgcc_s stubs
GCC 15 MinGW spec adds -lgcc_s alongside -lgcc_eh even when -static-libgcc is
set. With -Wl,-Bstatic active, -lgcc_s resolves to libgcc_s.a (MSYS2 ships a
static archive of DLL import stubs) which also contains _Unwind_Resume, causing
a duplicate definition error.
Fix: explicitly link -lgcc_eh and -lgcc in Bstatic mode at the very start of
extra-ldflags, before codec libs and before GCC's spec-added libs. The static
EH implementation lands first in the symbol table; --allow-multiple-definition
then silently ignores the duplicate stubs from libgcc_s.a that arrive later.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent eba7c97 commit 682ef37
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
0 commit comments