Package: python-greenlet
Version: 0.3.1-2
Severity: serious
x-debbugs-cc: storv...@gmail.com

Building python-greenlet in testing fails.

gcc -pthread -fno-strict-aliasing -g -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6_d -c greenlet.c -o build/temp.linux-armv7l-2.6-pydebug/greenlet.o
In file included from slp_platformselect.h:22:0,
                from greenlet.c:314:
platform/switch_arm32_gcc.h: In function 'slp_switch':
platform/switch_arm32_gcc.h:48:1: error: fp cannot be used in asm here
error: command 'gcc' failed with exit status 1

According to the buildd logs this also affects the version in TPU, it does not appear to affect the version in unstable (I haven't tested that one locally, i'm just basing on buildd logs here).

The source file says

*   It is not possible to detect if fp is used or not, so the supplied
*   switch function needs to support it, so that you can remove it if
*   it does not apply to you.

Looking at the unstable version of the source file it seems the code has been adjusted quite significantly to avoid this issue and also to save FPU registers (which were previously not saved which I imagine could cause all sorts of fun).

--- /chroots/wheezy/python-greenlet-0.3.1/platform/switch_arm32_gcc.h 2010-05-27 10:07:07.000000000 -0700 +++ /chroots/sid/python-greenlet-0.4.0/platform/switch_arm32_gcc.h 2012-05-14 14:10:04.000000000 -0700
@@ -25,26 +25,51 @@

#ifdef SLP_EVAL
#define STACK_MAGIC 0
-#define REGS_TO_SAVE /*"r1", "r2", "r3", "r4",*/ "r5", "r6", "fp", "ip", "lr"
+#define REG_SP "sp"
+#define REG_SPSP "sp,sp"
+#ifdef __thumb__
+#define REG_FP "r7"
+#define REG_FPFP "r7,r7"
+#define REGS_TO_SAVE_GENERAL "r4", "r5", "r6", "r8", "r9", "r10", "r11", "lr"
+#else
+#define REG_FP "fp"
+#define REG_FPFP "fp,fp"
+#define REGS_TO_SAVE_GENERAL "r4", "r5", "r6", "r7", "r8", "r9", "lr"
+#endif
+#if defined(__SOFTFP__)
+#define REGS_TO_SAVE REGS_TO_SAVE_GENERAL
+#elif defined(__VFP_FP__)
+#define REGS_TO_SAVE REGS_TO_SAVE_GENERAL, "d8", "d9", "d10", "d11", \
+                                           "d12", "d13", "d14", "d15"
+#elif defined(__MAVERICK__)
+#define REGS_TO_SAVE REGS_TO_SAVE_GENERAL, "mvf4", "mvf5", "mvf6", "mvf7", \ + "mvf8", "mvf9", "mvf10", "mvf11", \ + "mvf12", "mvf13", "mvf14", "mvf15"
+#else
+#define REGS_TO_SAVE REGS_TO_SAVE_GENERAL, "f4", "f5", "f6", "f7"
+#endif

static int
slp_switch(void)
{
+        void *fp;
        register int *stackref, stsizediff;
        __asm__ volatile ("" : : : REGS_TO_SAVE);
-        __asm__ ("mov %0,sp" : "=g" (stackref));
+ __asm__ volatile ("mov r0," REG_FP "\n\tstr r0,%0" : "=m" (fp) : : "r0");
+        __asm__ ("mov %0," REG_SP : "=r" (stackref));
        {
                SLP_SAVE_STATE(stackref, stsizediff);
                __asm__ volatile (
-                    "add sp,sp,%0\n"
-                    "add fp,fp,%0\n"
+                    "add " REG_SPSP ",%0\n"
+                    "add " REG_FPFP ",%0\n"
                    :
                    : "r" (stsizediff)
                    );
                SLP_RESTORE_STATE();
-                return 0;
        }
+ __asm__ volatile ("ldr r0,%0\n\tmov " REG_FP ",r0" : : "m" (fp) : "r0");
        __asm__ volatile ("" : : : REGS_TO_SAVE);
+        return 0;
}

#endif

There is and issue on mips* which looks superficially similar ( http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=665890 ) but unlike with the arm case I don't see any difference in the code in question.

Thoughts on how to get this package fixed for wheezy? (I doubt the release team will let the new upstream version from sid into wheezy at this point)


--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to