[Stackless] cross compile stackless from x86 to mipsel

Richard Tew richard.m.tew at gmail.com
Tue Feb 8 02:15:24 CET 2011

On Tue, Feb 8, 2011 at 5:10 AM, Luca Dionisi <luca.dionisi at gmail.com> wrote:

> I am trying, without success at the moment, to cross compile stackless
> (version 2.6.2) from a x86 host (linux) to a mips architecture.
> I gathered some info on various sites:
> http://www.cloudinto.com:8080/showItem/showDetail/7962913.html
> http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
> http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html#python
> I am using a OpenWRT buildroot as cross-compiler tools.
> What I get is a MIPS executable (and libs) that runs on my router (a
> Omnima ADM5120) but when I execute stackless.run() with some tasklet
> then it immediately does a segmentation fault.
> What could possibly have gone wrong?
Hi Luca,

I could only speculate about what went wrong.  Most likely it has to do with
the custom assembler used on each platform to do the stack switching.
 Perhaps it compiled in the wrong one (like the x86 assembler routine rather
than the ARM one), although I expect that to be unlikely.  More likely might
be that the custom assembler is not compatible with your compiler or target

Keep in mind that when assembler is used to context switch, the state of
registers which need to be preserved are saved before the switch is made and
that state is restored when whatever is being switched from is switched back
to.  If I were you, what I would do is to work out what routine is being
used when you cross-compile and what registers need to be saved.  You can do
this in a variety of ways, from reading source code of other switching
systems (like thread switching) to debugging the code on the target host and
seeing what bad register value it actually chokes on.

I have successfully cross-compiled Stackless for ARM before, although I had
to write my own switching routine.  But it was not with OpenWRT.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20110208/d66a6594/attachment.html>

More information about the Stackless mailing list