diff Makefile @ 557:b2ee86298516

Reduce default optimization level to -O2 It seems -O3 isn't as reliable as it maybe should be. There is plenty of information out there indicating that it is more likely to trigger compiler bugs so setting the default to -O2 instead.
author William Astle <lost@l-w.ca>
date Fri, 08 Sep 2023 00:35:11 -0600
parents 80b21c6b4a6b
children
line wrap: on
line diff
--- a/Makefile	Fri Sep 08 00:32:40 2023 -0600
+++ b/Makefile	Fri Sep 08 00:35:11 2023 -0600
@@ -48,7 +48,12 @@
 # snprintf() and friends. I'm using snprintf() precisely to prevent
 # overflows and I don't care if the string is truncated, so why should
 # I need to test the return value? Bleeping stupid.
-CFLAGS ?= -O3 -Wall -Wno-char-subscripts -Wno-format-truncation
+
+# -O3 breaks the build on some compiler/system targets so default to
+# -O2 which seems okay for now. Ideally identifying what breaks at
+# -O3 is indicated, but so far, identifying the specific source of
+# the breakage has been problematic.
+CFLAGS ?= -O2 -Wno-char-subscripts -Wno-format-truncation
 
 MAIN_TARGETS := lwasm/lwasm$(PROGSUFFIX) \
 	lwlink/lwlink$(PROGSUFFIX) \