From c744dbe9ac0e88e395a7464f20a4fd4184a0a222 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Fri, 8 Dec 2023 14:28:07 +0000 Subject: gh-112535: Update _Py_ThreadId() to support s390/s390x (gh-112751) --- Include/object.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Include/object.h b/Include/object.h index 85abd30..bd576b0 100644 --- a/Include/object.h +++ b/Include/object.h @@ -279,6 +279,10 @@ _Py_ThreadId(void) __asm__ ("" : "=r" (tp)); tid = tp; #endif +#elif defined(__s390__) && defined(__GNUC__) + // Both GCC and Clang have supported __builtin_thread_pointer + // for s390 from long time ago. + tid = (uintptr_t)__builtin_thread_pointer(); #else # error "define _Py_ThreadId for this platform" #endif -- cgit v0.12