commit:     7ba57dcd3ba259f31ccc0c8e1ff9fc4a395c8d8e
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 16 22:23:44 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Mar 16 22:27:43 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ba57dcd

dev-python/greenlet: Add Alpha support

greenlet-0.4.15-r1 was added to the tree for Python 3.8 support, but
some unknown mistake caused the KEYWORDS="-alpha -ia64 -hppa" to turn
into KEYWORDS="~alpha ~ia64 ~hppa". Might as well turn this lemon into
lemonade.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 ...greenlet-0.4.15-Add-support-for-DEC-Alpha.patch | 63 ++++++++++++++++++++++
 dev-python/greenlet/greenlet-0.4.15-r1.ebuild      |  4 ++
 2 files changed, 67 insertions(+)

diff --git 
a/dev-python/greenlet/files/greenlet-0.4.15-Add-support-for-DEC-Alpha.patch 
b/dev-python/greenlet/files/greenlet-0.4.15-Add-support-for-DEC-Alpha.patch
new file mode 100644
index 00000000000..6a5b37b0e94
--- /dev/null
+++ b/dev-python/greenlet/files/greenlet-0.4.15-Add-support-for-DEC-Alpha.patch
@@ -0,0 +1,63 @@
+https://github.com/python-greenlet/greenlet/pull/160
+
+From 839dfa8d4bc4e9a0b97a1984ab2519841f5511e4 Mon Sep 17 00:00:00 2001
+From: Matt Turner <[email protected]>
+Date: Mon, 16 Mar 2020 14:38:21 -0700
+Subject: [PATCH] Add support for DEC Alpha
+
+---
+ platform/switch_alpha_unix.h | 30 ++++++++++++++++++++++++++++++
+ slp_platformselect.h         |  2 ++
+ 2 files changed, 32 insertions(+)
+ create mode 100644 platform/switch_alpha_unix.h
+
+diff --git a/platform/switch_alpha_unix.h b/platform/switch_alpha_unix.h
+new file mode 100644
+index 0000000..216619f
+--- /dev/null
++++ b/platform/switch_alpha_unix.h
+@@ -0,0 +1,30 @@
++#define STACK_REFPLUS 1
++
++#ifdef SLP_EVAL
++#define STACK_MAGIC 0
++
++#define REGS_TO_SAVE "$9", "$10", "$11", "$12", "$13", "$14", "$15", \
++                   "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8", "$f9"
++
++static int
++slp_switch(void)
++{
++  register int ret;
++  register long *stackref, stsizediff;
++  __asm__ volatile ("" : : : REGS_TO_SAVE);
++  __asm__ volatile ("mov $30, %0" : "=r" (stackref) : );
++  {
++      SLP_SAVE_STATE(stackref, stsizediff);
++      __asm__ volatile (
++        "addq $30, %0, $30\n\t"
++        : /* no outputs */
++        : "r" (stsizediff)
++        );
++      SLP_RESTORE_STATE();
++  }
++  __asm__ volatile ("" : : : REGS_TO_SAVE);
++  __asm__ volatile ("mov $31, %0" : "=r" (ret) : );
++  return ret;
++}
++
++#endif
+diff --git a/slp_platformselect.h b/slp_platformselect.h
+index bed9e6d..fb99aed 100644
+--- a/slp_platformselect.h
++++ b/slp_platformselect.h
+@@ -51,4 +51,6 @@
+ #include "platform/switch_csky_gcc.h" /* gcc on csky */
+ #elif defined(__GNUC__) && defined(__riscv)
+ #include "platform/switch_riscv_unix.h" /* gcc on RISC-V */
++#elif defined(__GNUC__) && defined(__alpha__)
++#include "platform/switch_alpha_unix.h" /* gcc on DEC Alpha */
+ #endif
+-- 
+2.24.1
+

diff --git a/dev-python/greenlet/greenlet-0.4.15-r1.ebuild 
b/dev-python/greenlet/greenlet-0.4.15-r1.ebuild
index 3aa34d75264..25d63b0fc09 100644
--- a/dev-python/greenlet/greenlet-0.4.15-r1.ebuild
+++ b/dev-python/greenlet/greenlet-0.4.15-r1.ebuild
@@ -19,6 +19,10 @@ IUSE="doc"
 
 BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-Add-support-for-DEC-Alpha.patch
+)
+
 DISTUTILS_IN_SOURCE_BUILD=1
 
 distutils_enable_sphinx doc

Reply via email to