[Stackless] problem with build under linux ppc

Santiago Gala santiago.gala at gmail.com
Tue Aug 22 18:39:28 CEST 2006

I was having problems with stackless build under linux ppc, both
2.4.3-xx and 2.5.0-xx (svn) until I discovered the solution:

like darwin, linux ppc needs to *omit* the frame pointer in SLPFLAGS:

so the lines in configure.in:

case $MACHDEP in
                SLPFLAGS="-fomit-frame-pointer -O2"
                SLPFLAGS="-fno-omit-frame-pointer -O2"

should be changed so that linux with ppc processor has teh same
behaviour as darwin.

The symptoms of not having this:

- with unpatched sources, the cryptic error that follows:

./Stackless/core/slp_transfer.c: In function 'slp_transfer':
./Stackless/core/slp_transfer.c:150: error: 31 cannot be used in asm
./Stackless/core/slp_transfer.c:150: error: 31 cannot be used in asm
make: *** [Stackless/core/slp_transfer.o] Error 1

- with patched sources, where r31 is removed from the list of registers 
to be saved in Stackless/platf/switch_ppc_unix.h, like:

Index: Stackless/platf/switch_ppc_unix.h
--- Stackless/platf/switch_ppc_unix.h   (revisión: 51469)
+++ Stackless/platf/switch_ppc_unix.h   (copia de trabajo)
@@ -35,7 +35,7 @@
 #define STACK_MAGIC 3

 #define REGS_TO_SAVE "r13", "r14", "r15", "r16", "r17", "r18", "r19",
"r20", \
-       "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29",
"r31", \
+       "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29",
        "cr2", "cr3", "cr4"
 static int

 the problems are more elusive: first, either illegal instruction or
segfault while tryin to run setup.py

/bin/sh: line 1: 29079 Illegal instruction     CC='gcc -pthread'
LDSHARED='gcc -pthread -shared' OPT='-mcpu=7450 -mtune=7450 -maltivec
-mabi=altivec -ftree-vectorize -ftree-vectorizer-verbose=1 -O3 -g
-Wall' ./python -E ./setup.py build
make: *** [sharedmods] Error 132

this can be worked around using -S, and the resulting executable has the
same sort of problem, as it can be started only with -S and fail with
the same error in some operations.

But if I change SLPFLAGS like this:

SLPFLAGS=       -fomit-frame-pointer -O2

then stackless runs, no matter if r31 is saved or not, i.e. with
pristine sources or patched switch_ppc_unix.h

The main problem for sending a patch is that I don't grok binutils well
enough to test for linux-ppc where this variable is set.


Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list