summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorKenneth Olwing <knth@cpan.org>2022-08-25 18:48:26 +0200
committerKarl Williamson <khw@cpan.org>2022-08-27 16:41:16 -0600
commit51634b463845a03d4f22b9d23f6c5e2fb98af9c8 (patch)
tree15c9e57e05c0303c839b7cc26e2b13d4fc617117 /win32
parentcb9cb58bbc1606e8ad749a69d0b850dbdb89c606 (diff)
downloadperl-51634b463845a03d4f22b9d23f6c5e2fb98af9c8.tar.gz
Change optimization level for Win32 builds
This fixes #20136. Building on Windows 11 with the Strawberry 5.32.1 (gcc 8.3.0) toolchain, multiple errors in the tests are seen. Worse, building on Windows 10 no test errors crop up, but the resulting perl will still crash and die when run the tests manually on Windows 11. Changing the optimization level to -Os as found in #20024, the build now and tests now succeed.
Diffstat (limited to 'win32')
-rw-r--r--win32/GNUmakefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index 7b91d35ab0..81ded707b9 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -608,11 +608,16 @@ LIBFILES += -lquadmath
endif
ifeq ($(CFG),Debug)
-OPTIMIZE = -g -O2
+# According to https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Optimize-Options.html
+# -Og should provide some optimizations while still giving convenient debugging
+OPTIMIZE = -g -Og
LINK_DBG = -g
DEFINES += -DDEBUGGING
else
-OPTIMIZE = -O2
+# In https://github.com/Perl/perl5/issues/20081 it is found that the previous
+# optimization level -O2 causes generated code that fails in mysterious ways
+# when run on Win11 (*even* if it was built and successfully tested on Win10!).
+OPTIMIZE = -Os
LINK_DBG = -s
endif