@@ -323,3 +323,12 @@ PYTHON3_TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
ifeq ($(BR_BUILDING)$(BR2_PACKAGE_PYTHON3)$(BR2_TOOLCHAIN_USES_UCLIBC)-$(BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1),yyy-)
$(error Python3 doesn't work with uClibc and kernel headers < 5.1. Please use a different toolchain or unselect Python3.)
endif
+
+# Since python 3.13.x, uClibc-ng toolchain for aarch64 targets causes a
+# segfault at runtime. Encoding this as a dependency in
+# Config.in causes too many problems for propagating reverse
+# dependencies. Therefore instead we do a build time check.
+# https://lore.kernel.org/buildroot/7a4d245d-1556-43c9-8997-6b1f791afbfe@gmail.com/
+ifeq ($(BR_BUILDING)$(BR2_PACKAGE_PYTHON3)$(BR2_TOOLCHAIN_USES_UCLIBC)$(BR2_aarch64)$(BR2_aarch64_be),yyyy)
+$(error Python3 doesn't work with uClibc on aarch64. Please use a different toolchain or unselect Python3.)
+endif
As reported on the mailing list [1] while investigating the TestZfsUclibc Gitlab-CI failure, the python 3.13 interpreter itsef segfault at runtime: Fatal Python error: _PyThreadState_Attach: non-NULL old thread state Python runtime state: preinitialized Thread 0xSegmentation fault This issue is related to the python 3.13 version bump [2] were several internal changes were added [3] to support PEP 703 [4]. PEP 793 is about CPython’s global interpreter lock (“GIL”) removal for multi-threads support that requires a working C11 "thread_local" for thread-local storage [5]. Since it's only failing on uClibc-ng on aarch64 targets, do build-time detection of non-working uClibc-ng aarch64 toolchains. Another solution would be to completely disable uClibc-ng on aarch64 targets. [1] https://lore.kernel.org/buildroot/7a4d245d-1556-43c9-8997-6b1f791afbfe@gmail.com/ (TestZfsUclibc) [2] d63e207eb869063f82c867658676c2903beb08cb [3] https://github.com/python/cpython/commit/6e97a9647ae028facb392d12fc24973503693bd6 [4] https://peps.python.org/pep-0703/ [5] https://gcc.gnu.org/onlinedocs/gcc-15.1.0/gcc/Thread-Local.html Cc: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Romain Naour <romain.naour@smile.fr> --- package/python3/python3.mk | 9 +++++++++ 1 file changed, 9 insertions(+)