[3.15] gh-151546: Fix stack limits on musl (#151548) (#151583)

gh-151546: Fix stack limits on musl (#151548)

If the thread stack size is set by linker flags, pass the stack size
to Python/ceval.c via the new _Py_LINKER_THREAD_STACK_SIZE variable
to set Py_C_STACK_SIZE macro.

(cherry picked from commit 9a61d1c0c8)
This commit is contained in:
Victor Stinner
2026-06-17 11:13:40 +02:00
committed by GitHub
parent ff6e973c3b
commit a5c5edddbc
5 changed files with 16 additions and 1 deletions
+3 -1
View File
@@ -63,7 +63,9 @@ _Py_EnterRecursiveCallUnchecked(PyThreadState *tstate)
}
}
#if defined(__s390x__)
#if defined(_Py_LINKER_THREAD_STACK_SIZE)
# define Py_C_STACK_SIZE _Py_LINKER_THREAD_STACK_SIZE
#elif defined(__s390x__)
# define Py_C_STACK_SIZE 320000
#elif defined(_WIN32)
// Don't define Py_C_STACK_SIZE, ask the O/S