Source: python-greenlet Version: 0.4.0-1 Severity: wishlist User: debian-al...@lists.debian.org Usertags: alpha X-Debbugs-CC: debian-al...@lists.debian.org Tags: patch
python-greenlet FTBFS on Alpha due to missing architecture support. The attached patch provides the missing function needed to compile python-greenlet on Alpha. With the patch the build passes all the tests in the included test suite. Cheers Michael.
diff -Nurp python-greenlet-0.4.0.orig/platform/switch_alpha_unix.h python-greenlet-0.4.0/platform/switch_alpha_unix.h --- python-greenlet-0.4.0.orig/platform/switch_alpha_unix.h 1970-01-01 12:00:00.000000000 +1200 +++ python-greenlet-0.4.0/platform/switch_alpha_unix.h 2012-11-03 16:01:56.000000000 +1300 @@ -0,0 +1,39 @@ +/* + * this is the internal transfer function. + * + * HISTORY + * 2012-11-01 M. J. Cree + * Ported from extant code for other arches. + */ + +#define STACK_REFPLUS 1 + +#ifdef SLP_EVAL + +#define STACK_MAGIC 0 + + +#define REGS_TO_SAVE "$9", "$10", "$11", "$12", "$13", "$14", "$15", \ + "$26" + +static int +slp_switch(void) +{ + register int *stackref, stsizediff; + __asm__ __volatile__ ("" : : : REGS_TO_SAVE); + __asm__ ("mov $sp, %0" : "=r" (stackref) : ); + { + SLP_SAVE_STATE(stackref, stsizediff); + __asm__ __volatile__ ( + "addq $sp, %0, $sp\n" + "addq $fp, %0, $fp\n" + : /* no outputs */ + : "r" (stsizediff) + ); + SLP_RESTORE_STATE(); + } + __asm__ __volatile__ ("" : : : REGS_TO_SAVE); + return 0; +} + +#endif diff -Nurp python-greenlet-0.4.0.orig/slp_platformselect.h python-greenlet-0.4.0/slp_platformselect.h --- python-greenlet-0.4.0.orig/slp_platformselect.h 2012-05-13 08:56:32.000000000 +1200 +++ python-greenlet-0.4.0/slp_platformselect.h 2012-11-03 16:01:49.000000000 +1300 @@ -32,4 +32,6 @@ #include "platform/switch_arm32_gcc.h" /* gcc using arm32 */ #elif defined(__GNUC__) && defined(__mips__) && defined(__linux__) #include "platform/switch_mips_unix.h" /* Linux/MIPS */ +#elif defined(__GNUC__) && defined(__alpha__) +#include "platform/switch_alpha_unix.h" /* Alpha AXP */ #endif