https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89166
--- Comment #3 from Liviu Ionescu <ilg at livius dot net> --- I tried all sort of configurations to build static executables, but I could not find one that works while building Windows binaries (with mingw) and still allow the liblto_plugin-0.dll to be created. If the subject is not appropriate, please suggest a better one, but that is the idea, building static binaries had the side effect of disabling the plugin. The current workaround I used in my build script was to make the binaries 'almost' static, except libwinpthread.dll, which I had to copy in the distribution. Far from perfect, but apparently functional. If there is a better way to do this, I'm ready to give it a try.