diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index f27ec4350bb2c8..7ffe9871f46999 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -134,7 +134,7 @@ _Py_CODEUNIT *_PyTier2Interpreter( #endif #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 2cd23fa3c58849..8680277c115e5f 100644 --- a/Modules/_testinternalcapi/interpreter.c +++ b/Modules/_testinternalcapi/interpreter.c @@ -21,8 +21,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 950050a6027116..fbc9c3dab710a5 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1314,9 +1314,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int } #ifdef _Py_TIER2 #ifdef _Py_JIT -_PyJitEntryFuncPtr _Py_jit_entry = _Py_LazyJitShim; +PyAPI_DATA(_PyJitEntryFuncPtr) _Py_jit_entry = _Py_LazyJitShim; #else -_PyJitEntryFuncPtr _Py_jit_entry = _PyTier2Interpreter; +PyAPI_DATA(_PyJitEntryFuncPtr) _Py_jit_entry = _PyTier2Interpreter; #endif #endif