From 4d04da926a1f3648d46420a4b47f73c87341944b Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Wed, 11 Mar 2026 20:28:22 +0300 Subject: [PATCH 1/4] export _Py_jit_entry symbol via PyAPI_DATA --- Include/internal/pycore_ceval.h | 2 +- Python/ceval.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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/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 From 478d086862367fd06dd0a4e07c80634997e83c6c Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Wed, 11 Mar 2026 20:28:28 +0300 Subject: [PATCH 2/4] add NEWS entry --- .../Build/2026-03-11-17-23-39.gh-issue-144712.fix-jit-entry.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2026-03-11-17-23-39.gh-issue-144712.fix-jit-entry.rst 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. From ec9b77593e6d3977038c6e6108494934e2d33399 Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Wed, 11 Mar 2026 20:38:03 +0300 Subject: [PATCH 3/4] use extern for _Py_jit_entry in _testinternalcapi --- Modules/_testinternalcapi/interpreter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_testinternalcapi/interpreter.c b/Modules/_testinternalcapi/interpreter.c index 2cd23fa3c58849..653332f707326d 100644 --- a/Modules/_testinternalcapi/interpreter.c +++ b/Modules/_testinternalcapi/interpreter.c @@ -21,7 +21,7 @@ stop_tracing_and_jit(PyThreadState *tstate, _PyInterpreterFrame *frame) } #endif -_PyJitEntryFuncPtr _Py_jit_entry; +extern _PyJitEntryFuncPtr _Py_jit_entry; #if _Py_TAIL_CALL_INTERP #include "test_targets.h" From 2edb534ebbbab4ef8649c746feeb2e3719d0c1eb Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Wed, 11 Mar 2026 20:40:12 +0300 Subject: [PATCH 4/4] remove redundant _Py_jit_entry declaration in _testinternalcapi --- Modules/_testinternalcapi/interpreter.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Modules/_testinternalcapi/interpreter.c b/Modules/_testinternalcapi/interpreter.c index 653332f707326d..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 -extern _PyJitEntryFuncPtr _Py_jit_entry; - #if _Py_TAIL_CALL_INTERP #include "test_targets.h" #include "test_cases.c.h"