# [Stackless] cross compile stackless from x86 to mipsel

Richard Tew richard.m.tew at gmail.com
Tue Feb 8 13:41:03 CET 2011

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

> I am not so keen on debugging with linux tools, even more with
> assembly. So I tried to use preprocessor directives to find out
> (#warning 'blah blah')
> I found that __GNUC__, __linux__ and __mips__ are defined.
> But, *if* I use correctly the #warning directives, they seem to tell
> that the assembly code is not being used.
>
> I have no idea what the difference between correctly and incorrectly is.

But you will note that there is a clause in 'stackless.h' which keeps
STACKLESS defined if these three symbols are defined.  So given that, the
standard Stackless MIPS switching should be compiled in.

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.

> Do you have an idea why this has been advised? Are they useful for
> cross compilation purposes?
>

Don't know.

> 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__)

Also note that 'Stackless\platf\slp_platformselect.h' is used to
generate 'Stackless\platf\slp_switch_stack.h'.

Anyway, you should be able to use the above information to examine where you
are at.

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