[packages/python3] Fix 3.15.0 tests on x32 and i686
arekm
arekm at pld-linux.org
Sat Oct 10 01:52:21 CEST 2026
commit 3eabaac19fedcfc3c48706b188718af52d4b5b1e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Fri Oct 9 23:26:18 2026 +0200
Fix 3.15.0 tests on x32 and i686
Keep upstream frame pointers
python3-test-unwind-x32.patch | 17 +++++++++++++++++
python3-tests.patch | 3 ++-
python3.spec | 4 ++++
3 files changed, 23 insertions(+), 1 deletion(-)
---
diff --git a/python3.spec b/python3.spec
index 102669a..9d0a579 100644
--- a/python3.spec
+++ b/python3.spec
@@ -72,6 +72,7 @@ Patch14: python3-profile-tests.patch
Patch15: python3-tests.patch
Patch17: python3-test-subprocess-userns.patch
Patch19: python3-configure-posix-sh.patch
+Patch20: python3-test-unwind-x32.patch
URL: https://www.python.org/
BuildRequires: autoconf >= 2.72
BuildRequires: autoconf-archive
@@ -117,6 +118,8 @@ Conflicts: python < 1:2.7.18-10
%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# configure enables frame pointers for native profilers; optflags would omit them on ix86/arm
+%define filterout_c -fomit-frame-pointer
%define specflags_ppc -D__ppc__=1
%define specflags_ppc64 -D__ppc64__=1
@@ -481,6 +484,7 @@ Moduły testowe dla Pythona.
%patch -P 15 -p1
%patch -P 17 -p1
%patch -P 19 -p1
+%patch -P 20 -p1
%{__rm} -r Modules/expat
diff --git a/python3-test-unwind-x32.patch b/python3-test-unwind-x32.patch
new file mode 100644
index 0000000..8094b72
--- /dev/null
+++ b/python3-test-unwind-x32.patch
@@ -0,0 +1,17 @@
+test_c_stack_unwind: on x32 the manual unwinder read the upper half of the
+saved rbp as the return address (always 0) and found no Python frames.
+
+--- Python-3.15.0.orig/Modules/_testinternalcapi.c 2026-10-09 23:24:21.282818226 +0200
++++ Python-3.15.0/Modules/_testinternalcapi.c 2026-10-09 23:24:21.359484893 +0200
+@@ -103,6 +103,11 @@ static const uintptr_t min_frame_pointer
+ // See: https://riscv-non-isa.github.io/riscv-elf-psabi-doc/#_frame_pointer_convention
+ # define FRAME_POINTER_NEXT_OFFSET -2
+ # define FRAME_POINTER_RETURN_OFFSET -1
++#elif defined(__x86_64__) && defined(__ILP32__)
++// x32 pushes the saved rbp and the return address as 8-byte slots while
++// uintptr_t is 4 bytes, so the (little-endian) return address is at fp[2].
++# define FRAME_POINTER_NEXT_OFFSET 0
++# define FRAME_POINTER_RETURN_OFFSET 2
+ #else
+ # define FRAME_POINTER_NEXT_OFFSET 0
+ # define FRAME_POINTER_RETURN_OFFSET 1
diff --git a/python3-tests.patch b/python3-tests.patch
index 8566c65..938e463 100644
--- a/python3-tests.patch
+++ b/python3-tests.patch
@@ -32,7 +32,8 @@ diff -urNp -x '*.orig' Python-3.9.2.org/Lib/test/test_imaplib.py Python-3.9.2/Li
'site-packages')
self.assertEqual(dirs[0], wanted)
else:
- self.assertEqual(len(dirs), 1)
+- self.assertEqual(len(dirs), 1)
++ self.assertEqual(len(dirs), 3)
- wanted = os.path.join('xoxo', 'lib',
+ wanted = os.path.join('xoxo', 'share',
f'python{sysconfig._get_python_version_abi()}',
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3.git/commitdiff/3eabaac19fedcfc3c48706b188718af52d4b5b1e
More information about the pld-cvs-commit
mailing list