[Stackless] cross compile stackless from x86 to mipsel

Luca Dionisi luca.dionisi at gmail.com
Tue Feb 8 14:55:21 CET 2011

On Tue, Feb 8, 2011 at 1:41 PM, Richard Tew <richard.m.tew at gmail.com> wrote:
> Note that if your platform is not supported, then STACKLESS will be
> undefined, and the conditional clauses should compiled a normal Python
> without any Stackless functionality.  So if your resulting compiled 'python'
> gives an ImportError on 'import stackless', then you do not have switching
> support for its platform.

import stackless does not raise ImportError. So it should have
Stackless functionality.
Only problem is segfault when running stackless.run().

>> ARM? Interesting. By reading this file:
>> http://svn.python.org/projects/stackless/trunk/Stackless/stackless.h
>> I thought that ARM was not supported yet. There is no line with 'arm'.
>> I conclude that I am not looking at the right files.
>> Where do I look to understand which platforms are supported?
> It has been some time since I last had to look at this code in detail, but
> here is how I recall it working.  When you compile Stackless,
> 'Stackless\stackless.h' and its clauses determine whether you a normal
> Python or a Stackless Python.  If your platform has switching support as
> defined by 'Stackless\platf\slp_platformselect.h' but there is no entry
> in 'Stackless\stackless.h', then you should be able to add the relevant
> combination of define checking as an entry so that 'STACKLESS' is not
> undefined.
> e.g. You can see the following in 'Stackless\platf\slp_platformselect.h' but
> not 'Stackless\stackless.h'.
>   #elif defined(__GNUC__) && defined(__arm__) && defined(__thumb__)

Ok, now I got it.

On Tue, Feb 8, 2011 at 2:06 PM, W-Mark Kubacki <wmark at hurrikane.de> wrote:
> As somewhere already mentioned, it is most probably wrong or missing
> ARM code which caused the segfault. I've ported some packages to ARM,
> maybe one of these hints will help you:
> 0. Before making assumptions about what macros should have been
> enabled on your architecture, better have them displayed:
> # echo | gcc -E -dD -
> 1. Try compiling without -Os or -O2 and the such.
> 2. Find where any arch-dependent code is used.
> 4. Append one or modify any present #define. If you don't know asm,
> try using a GCC built-ins [1], or better yet, use libatomic_ops [2].
> (I wish every project would use the latter as fallback for any not
> already covered arch.)
> 5. If you still get segfaults, try saving less (or more) registers -
> refer to your arch's handbook. Here's an example of mine [4]. The code
> should remind you of Stackless ;-)
> --
> Mark
> http://mark.ossdl.de/
> [1] http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html
> [2] http://www.hpl.hp.com/research/linux/atomic_ops/
> [3] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0235c/index.html
> [4] https://github.com/wmark/ossdl-overlay/blob/master/dev-python/greenlet/files/greenlet-0.2-arm32.patch
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless

Very interesting links. Thank you.

I will report back when I get to do more tests.


More information about the Stackless mailing list