]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120688: Build WASI with -O3 in debug mode (#120691)
authorVictor Stinner <vstinner@python.org>
Tue, 18 Jun 2024 17:35:44 +0000 (19:35 +0200)
committerGitHub <noreply@github.com>
Tue, 18 Jun 2024 17:35:44 +0000 (19:35 +0200)
On WASI in debug mode, Python is now built with compiler flag -O3
instead of -Og, to support more recursive calls.

Misc/NEWS.d/next/Build/2024-06-18-15-32-36.gh-issue-120688.tjIPLD.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2024-06-18-15-32-36.gh-issue-120688.tjIPLD.rst b/Misc/NEWS.d/next/Build/2024-06-18-15-32-36.gh-issue-120688.tjIPLD.rst
new file mode 100644 (file)
index 0000000..90f1f91
--- /dev/null
@@ -0,0 +1,3 @@
+On WASI in debug mode, Python is now built with compiler flag ``-O3``
+instead of ``-Og``, to support more recursive calls. Patch by Victor
+Stinner.
index 003f68afae2cab0678d9f3e689e50b9c7504477b..0f7ea7dfb5259dcba30493844b4fc0a305bf4dec 100755 (executable)
--- a/configure
+++ b/configure
@@ -9414,6 +9414,11 @@ then :
   PYDEBUG_CFLAGS="-Og"
 fi
 
+# gh-120688: WASI uses -O3 in debug mode to support more recursive calls
+if test "$ac_sys_system" = "WASI"; then
+    PYDEBUG_CFLAGS="-O3"
+fi
+
 # tweak OPT based on compiler and platform, only if the user didn't set
 # it on the command line
 
index f9612b3275d3f0bffa5864c0e602faea73eca17a..a46984514651556d063a2dfff055bb02458026ef 100644 (file)
@@ -2289,6 +2289,11 @@ PYDEBUG_CFLAGS="-O0"
 AS_VAR_IF([ac_cv_cc_supports_og], [yes],
           [PYDEBUG_CFLAGS="-Og"])
 
+# gh-120688: WASI uses -O3 in debug mode to support more recursive calls
+if test "$ac_sys_system" = "WASI"; then
+    PYDEBUG_CFLAGS="-O3"
+fi
+
 # tweak OPT based on compiler and platform, only if the user didn't set
 # it on the command line
 AC_SUBST([OPT])