From 00c9eb30f2b188f6652755401216805b83456005 Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Tue, 19 May 2026 14:27:07 +0300 Subject: [PATCH] gh-144712: Export _Py_jit_entry symbol via PyAPI_DATA --- Include/internal/pycore_ceval.h | 2 +- .../2026-03-11-17-23-39.gh-issue-144712.fix-jit-entry.rst | 1 + Modules/_testinternalcapi/interpreter.c | 2 -- Python/ceval.c | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-03-11-17-23-39.gh-issue-144712.fix-jit-entry.rst diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index fd4221f0816d24..ecd30472b973b0 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -131,7 +131,7 @@ _Py_CODEUNIT *_PyTier2Interpreter( ); #endif -extern _PyJitEntryFuncPtr _Py_jit_entry; +PyAPI_DATA(_PyJitEntryFuncPtr) _Py_jit_entry; extern PyObject* _PyEval_Vector(PyThreadState *tstate, diff --git a/Misc/NEWS.d/next/Build/2026-03-11-17-23-39.gh-issue-144712.fix-jit-entry.rst b/Misc/NEWS.d/next/Build/2026-03-11-17-23-39.gh-issue-144712.fix-jit-entry.rst new file mode 100644 index 00000000000000..3473ce141dc03a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-03-11-17-23-39.gh-issue-144712.fix-jit-entry.rst @@ -0,0 +1 @@ +Fix ``_testinternalcapi`` import failure due to missing ``_Py_jit_entry`` symbol when built with :option:`--enable-experimental-jit`. Patch by Shamil Abdulaev. diff --git a/Modules/_testinternalcapi/interpreter.c b/Modules/_testinternalcapi/interpreter.c index 99dcd18393fb87..6e0ca939084fb8 100644 --- a/Modules/_testinternalcapi/interpreter.c +++ b/Modules/_testinternalcapi/interpreter.c @@ -24,8 +24,6 @@ stop_tracing_and_jit(PyThreadState *tstate, _PyInterpreterFrame *frame) } #endif -_PyJitEntryFuncPtr _Py_jit_entry; - #if _Py_TAIL_CALL_INTERP #include "test_targets.h" #include "test_cases.c.h" diff --git a/Python/ceval.c b/Python/ceval.c index a080ae42b93766..4d5a4a8e40ba9f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1337,9 +1337,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int } #ifdef _Py_TIER2 #ifdef _Py_JIT -_PyJitEntryFuncPtr _Py_jit_entry = _PyJIT_Entry; +PyAPI_DATA(_PyJitEntryFuncPtr) _Py_jit_entry = _PyJIT_Entry; #else -_PyJitEntryFuncPtr _Py_jit_entry = _PyTier2Interpreter; +PyAPI_DATA(_PyJitEntryFuncPtr) _Py_jit_entry = _PyTier2Interpreter; #endif #endif