Skip to content

Commit d7262cc

Browse files
committed
Don't require glibc if it isn't linux.
This exempts alpine but doesn't affect, eg, FreeBSD.
1 parent 0d8f676 commit d7262cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Python/ceval.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,11 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
442442
_tstate->c_stack_soft_limit = _tstate->c_stack_hard_limit + PYOS_STACK_MARGIN_BYTES;
443443
#else
444444
uintptr_t here_addr = _Py_get_machine_stack_pointer();
445+
/// XXX musl supports HAVE_PTHRED_GETATTR_NP, but the resulting stack size
446+
/// (on alpine at least) is much smaller than expected and imposes undue limits
447+
/// compared to the old stack size estimation.
445448
# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && \
446-
!defined(__NetBSD__) && defined(__GLIBC__)
449+
!defined(__NetBSD__) && (defined(__GLIBC__) || !defined(__linux__))
447450
size_t stack_size, guard_size;
448451
void *stack_addr;
449452
pthread_attr_t attr;

0 commit comments

Comments
 (0)