From aae977c45f098bcb93ea0842b86552f86ddb2781 Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Thu, 21 Dec 2023 17:56:51 +0800 Subject: [PATCH] Update switch_ppc_aix.h Signed-off-by: zhang-liang-pengkun --- 0003-Update-switch_ppc_aix.h.patch | 35 ++++++++++++++++++++++++++++++ python-greenlet.spec | 6 ++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0003-Update-switch_ppc_aix.h.patch diff --git a/0003-Update-switch_ppc_aix.h.patch b/0003-Update-switch_ppc_aix.h.patch new file mode 100644 index 0000000..12b9d74 --- /dev/null +++ b/0003-Update-switch_ppc_aix.h.patch @@ -0,0 +1,35 @@ +From 8911c385326d539f299cd6f2c3e395cd5417f996 Mon Sep 17 00:00:00 2001 +From: k2uhl +Date: Tue, 21 May 2019 21:39:19 -0500 +Subject: [PATCH] Update switch_ppc_aix.h + +Based off abarnert's feedback on stackexchange, force use of a register instead of suggesting. From: +https://stackoverflow.com/questions/11587635/cross-compile-of-pythons-greenlet-and-gevent-on-linux-x86-64-for-powerpc +--- + platform/switch_ppc_aix.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/platform/switch_ppc_aix.h b/platform/switch_ppc_aix.h +index 45a277a..c7d476f 100644 +--- a/platform/switch_ppc_aix.h ++++ b/platform/switch_ppc_aix.h +@@ -56,14 +56,14 @@ slp_switch(void) + register int err; + register int *stackref, stsizediff; + __asm__ volatile ("" : : : REGS_TO_SAVE); +- __asm__ ("mr %0, 1" : "=g" (stackref) : ); ++ __asm__ ("mr %0, 1" : "=r" (stackref) : ); + { + SLP_SAVE_STATE(stackref, stsizediff); + __asm__ volatile ( + "mr 11, %0\n" + "add 1, 1, 11\n" + : /* no outputs */ +- : "g" (stsizediff) ++ : "r" (stsizediff) + : "11" + ); + SLP_RESTORE_STATE(); +-- +2.39.0.windows.2 + diff --git a/python-greenlet.spec b/python-greenlet.spec index 45db1c5..7a1b896 100644 --- a/python-greenlet.spec +++ b/python-greenlet.spec @@ -1,12 +1,13 @@ Name: python-greenlet Version: 0.4.14 -Release: 6 +Release: 7 Summary: lightweight coroutines for in-process concurrent programming License: MIT URL: https://github.com/python-greenlet/greenlet Source0: https://github.com/python-greenlet/greenlet/archive/0.4.14.tar.gz Patch0001: 0001-Add-support-for-RISC-V.patch Patch0002: 0002-Workaround-a-gcc-bug-using-manual-save-restore-of-r3.patch +Patch0003: 0003-Update-switch_ppc_aix.h.patch BuildRequires: python2-devel python2-setuptools python3-devel python3-setuptools BuildRequires: gcc-c++ @@ -85,6 +86,9 @@ that use python3-greenlet. %{_includedir}/python%{python3_version}*/greenlet/ %changelog +* Thu Oct 23 2023 zhangliangpengkun - 0.4.14-7 +- Update switch_ppc_aix.h + * Thu Nov 02 2023 zhangliangpengkun - 0.4.14-6 - Workaround a gcc bug using manual save/restore of r30 -- Gitee