mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
08fa3765ba
A default MinGW build dynamically imports three non-system DLLs (SDL2.dll, libgcc_s_seh-1.dll, libstdc++-6.dll) that get bundled side-by-side. On a user machine with a mismatched-architecture copy of one of those earlier on the DLL search path, Windows loads the wrong one and the process dies at launch with 0xc000007b (STATUS_INVALID_IMAGE_FORMAT) before any of our code runs. Add PSX_STATIC_RUNTIME (default ON for MinGW Release/MinSizeRel): link -static -static-libgcc -static-libstdc++ and pull SDL2 from the pkg-config --static line (libSDL2.a + its Windows system-lib chain) instead of the import lib. The resulting exe imports only Windows system DLLs, so it runs from any folder and 0xc000007b from a mismatched runtime DLL becomes structurally impossible. package_release.ps1 no longer bundles the runtime DLLs and instead asserts self-containment via objdump (fails the build if any non-system import remains). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>