From 78ff7e2cd68e35f95818a434a7f2a330e9fcd150 Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Tue, 28 May 2024 07:11:33 +0300 Subject: [PATCH] comment on why -static is used with MinGW build --- premake5.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/premake5.lua b/premake5.lua index b049482f..2a57a05c 100644 --- a/premake5.lua +++ b/premake5.lua @@ -407,7 +407,10 @@ filter { "system:windows", "action:gmake*", } } -- source: https://gcc.gnu.org/onlinedocs/gcc/Cygwin-and-MinGW-Options.html linkoptions { - "-static-libgcc", "-static-libstdc++", "-static", + -- I don't know why but if libgcc/libstdc++ as well as pthreads are not statically linked + -- none of the output binary .dlls will reach their DllMain() in x64dbg + -- even when they're force-loaded in any process they immediately unload + "-static", -- from docs: "specifies that the typical Microsoft Windows predefined macros are to be set in the pre-processor, -- but does not influence the choice of runtime library/startup code" -- optional really