I have a third-party library which depends on libgcc_s_sjlj-1.dll
.
My own program is compiled under MSYS2 (mingw-w64) and it depends on libgcc_s_dw2-1.dll
.
Please note that the third-party library is pure binaries (no source). Please also note that both libgcc_s_sjlj-1.dll
and libgcc_s_dw2-1.dll
are 32-bit, so I don't think it's an issue related to architecture.
The outcome is apparent, programs compiled based on libgcc_s_dw2-1.dll
can't work with third-party libraries based on libgcc_s_sjlj-1.dll
. What I get is a missing entrypoint __gxx_personality_sj0
.
I can definitely try to adapt my toolchain to align with the third-party's libgcc_s_sjlj-1.dll
, but I do not know how much effort I need to go about doing it. I find no such variant of libgcc dll under MSYS2 using this setjmp/longjmp version. I am even afraid that I need to eliminate the entire toolchain because all the binaries I had under MSYS2 sits atop this libgcc_s_dw2-1.dll
module.
My goal is straightforward: I would like to find a solution so that my code will sit on top of libgcc_s_sjlj-1.dll
instead of libgcc_s_dw2-1.dll
. But I don't know if I am asking a stupid question simply because this is just not possible.
The terms dw2 and sjlj refer to two different types of exception handling that GCC can use on Windows. I don't know the details, but I wouldn't try to link binaries using the different types. Since MSYS2 does not provide an sjlj toolchain, you'll have to find one somewhere else. I would recommend downloading one from the "MingW-W64-builds" project, which you can find listed on this page:
https://mingw-w64.org/doku.php/download
You could use MSYS2 as a Bash shell but you can probably not link to any of its libraries in your program; you would need to recompile all libraries yourself (except for this closed source third-party one).