Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address Victor review
Co-Authored-By: Victor Stinner <vstinner@python.org>
  • Loading branch information
Fidget-Spinner and vstinner committed Apr 10, 2026
commit a95c401df5b884633b9f1ebbf344cc1778b099fe
6 changes: 6 additions & 0 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,12 @@ Compiler flags

.. versionadded:: 3.7

.. envvar:: CFLAGS_CEVAL

Flags used to compile ``Python/ceval.c``.

.. versionadded:: 3.14.5
Comment thread
vstinner marked this conversation as resolved.

.. envvar:: CCSHARED

Compiler flags used to build a shared library.
Expand Down
18 changes: 9 additions & 9 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7374,10 +7374,10 @@ fi
AC_MSG_CHECKING([if we need to manually block large inlining in ceval.c])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void) {
// See gh-148284:
// Clang 22 seems to have interactions with inlining and the stackref buffer
// which cause 40kB of stack usage on x86-64 in buggy versions of _PyEval_EvalFrameDefault
// in computed goto interpreter. The normal usage seen is normally 1-2kB.
// See gh-148284: Clang 22 seems to have interactions with inlining
// and the stackref buffer which cause 40 kB of stack usage on x86-64
// in buggy versions of _PyEval_EvalFrameDefault() in computed goto
// interpreter. The normal usage seen is normally 1-2 kB.
#if defined(__clang__) && (__clang_major__ == 22)
return 1;
#else
Expand All @@ -7391,11 +7391,11 @@ int main(void) {
AC_MSG_RESULT([$block_huge_inlining_in_ceval])

if test "$block_huge_inlining_in_ceval" = yes && test "$ac_cv_computed_gotos" = yes; then
// This number should be tuned to follow the C stack consumption
// in _PyEval_EvalFrameDefault on computed goto interpreter.
CFLAGS_CEVAL="-finline-max-stacksize=512"
else
CFLAGS_CEVAL=""
# gh-148284: Suppress inlining of functions whose stack size exceeds
# 512 bytes. This number should be tuned to follow the C stack
# consumption in _PyEval_EvalFrameDefault() on computed goto
# interpreter.
CFLAGS_CEVAL="$CFLAGS_CEVAL -finline-max-stacksize=512"
fi
AC_SUBST([CFLAGS_CEVAL])

Expand Down