diff --git a/packaging/rpm/patches/03ae30013de3fde03719c9b1c9c53b39c389b599.patch b/packaging/rpm/patches/03ae30013de3fde03719c9b1c9c53b39c389b599.patch new file mode 100644 index 0000000000..0a68ffdcde --- /dev/null +++ b/packaging/rpm/patches/03ae30013de3fde03719c9b1c9c53b39c389b599.patch @@ -0,0 +1,27 @@ +From 03ae30013de3fde03719c9b1c9c53b39c389b599 Mon Sep 17 00:00:00 2001 +From: Daniele Nicolodi +Date: Mon, 27 Mar 2023 21:41:56 +0200 +Subject: [PATCH] Fix compilation with CPython 3.12a6 + +CPython 3.12a6 made PyThreadState an opaque structure thus the fast +thread state optimization cannot be employed anymore. + +Fixes #5286. +--- + Cython/Utility/ModuleSetupCode.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c +index e461cda1e7..950d89a679 100644 +--- a/Cython/Utility/ModuleSetupCode.c ++++ b/Cython/Utility/ModuleSetupCode.c +@@ -331,7 +331,8 @@ + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE +- #define CYTHON_FAST_THREAD_STATE 1 ++ // CPython 3.12a6 made PyThreadState an opaque struct. ++ #define CYTHON_FAST_THREAD_STATE (PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_FAST_GIL + // Py3<3.5.2 does not support _PyThreadState_UncheckedGet().