Skip to content

Commit 212b6a3

Browse files
committed
Revert python/cpython#139232 for testing
1 parent d010489 commit 212b6a3

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

cpython-unix/build-cpython.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,11 @@ if [ -n "${CPYTHON_OPTIMIZED}" ]; then
522522
fi
523523
fi
524524

525+
# Revert problematic C stack limits refactoring on 3.15 (macOS build issue)
526+
if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_15}" && "${PYBUILD_PLATFORM}" = macos* ]]; then
527+
patch -p1 -i "${ROOT}/patch-revert-stack-limits-3.15.patch"
528+
fi
529+
525530
if [ -n "${CPYTHON_LTO}" ]; then
526531
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-lto"
527532
fi
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/Python/ceval.c b/Python/ceval.c
2+
index f48f412fab8..3bf1c098003 100644
3+
--- a/Python/ceval.c
4+
+++ b/Python/ceval.c
5+
@@ -448,12 +448,6 @@ hardware_stack_limits(uintptr_t *top, uintptr_t *base)
6+
ULONG guarantee = 0;
7+
SetThreadStackGuarantee(&guarantee);
8+
*base = (uintptr_t)low + guarantee;
9+
-#elif defined(__APPLE__)
10+
- pthread_t this_thread = pthread_self();
11+
- void *stack_addr = pthread_get_stackaddr_np(this_thread); // top of the stack
12+
- size_t stack_size = pthread_get_stacksize_np(this_thread);
13+
- *top = (uintptr_t)stack_addr;
14+
- *base = ((uintptr_t)stack_addr) - stack_size;
15+
#else
16+
/// XXX musl supports HAVE_PTHRED_GETATTR_NP, but the resulting stack size
17+
/// (on alpine at least) is much smaller than expected and imposes undue limits

0 commit comments

Comments
 (0)