Makefiles: compile 32bit Winsows with `-O0`
This is a horrible hack - on i686 St/X is known to crash when
compiled with -O2 using GCC >9. To circumvent this, compile 32bit
version with `-O0` which is known to work.
Naturally, this is horrible hack, but in the past, people made so
many "cool optimizations" on i686 only that they break with every
new GCC (UB). There are so many it would take significant effort
to clean up. And there's little gain from that as of today (Dec 2020).
So, sorry for that, but no optimizations on 32bit Windows.
--- a/makelib/definitions-w.make Tue Dec 01 19:48:05 2020 +0000
+++ b/makelib/definitions-w.make Wed Dec 02 21:11:00 2020 +0000
@@ -775,7 +775,23 @@
LIB_SUBSYSTEM=console
!if defined(USEMINGW32) || defined(USEMINGW64)
-OPT=-fPIC -O2 -fno-strict-aliasing -Wno-strict-aliasing -fno-stack-protector -ggdb3 -pipe -U_FORTIFY_SOURCE -D__USE_MINGW_ANSI_STDIO=0
+OPT_COMMON=-fPIC -fno-strict-aliasing -Wno-strict-aliasing -fno-stack-protector -ggdb3 -pipe -U_FORTIFY_SOURCE -D__USE_MINGW_ANSI_STDIO=0
+! if defined(USEMINGW32)
+#
+# A horrible hack - on i686 St/X is known to crash when compiled with -O2.
+# To circumvent this, compile 32bit version with -O0 which is known to work.
+#
+# Naturally, this is horrible hack, but in the past, people made so many "cool optimizations"
+# in i686 only that they break with every new GCC (UB). There are so many it would
+# take significant effort to clean up. And there's little gain from that as of today
+# (Dec 2020).
+#
+# So, sorry for that, but:
+#
+OPT=$(OPT_COMMON) -O0
+! else
+OPT=$(OPT_COMMON) -O2
+! endif
CFLAGS=$(OPT) $(CFLAGS1) $(CFLAGS2) $(LOCALINCLUDES) $(CLOCAL_INCL) $(CFLAGS_LOCAL)
!endif