cross compile Python to Linux-ARM

David Boddie david at boddie.org.uk
Sat Mar 21 11:59:07 EDT 2009


On Thursday 19 March 2009 17:54, jefm wrote:

> We are looking to use Python on an embedded Linux ARM system.
> What I gather from googling the subject is that it is not that
> straight forward (a fair amount of patching & hacking).
> Nobody out there that has done it claims it is easy, which makes me
> worried.

I think the hard part is often getting a working cross-compiler. The changes
to Python are just inconvenient, not difficult.

> I haven't seen a description on porting Python 2.6 or 3.0 yet. Is it
> much different than for the earlier versions (the latest I have seem
> is Python 2.5).
> 
> Does it matter whether Python is cross compiled to Linux 2.4 or Linux
> 2.6 ?

Unless Python has been changed to rely on features only provided by Linux
2.6, it shouldn't matter. Of course, you need to make sure your toolchain
matches the kernel on your device, and that may be a constraint you can't
easily change.

> Can anyone point to a howto they know works well ?

Not really. There are plenty of sites that claim to have good "recipes" for
cross-compiling, but many of them are out of date.

> What are the chances of an 'officially' supported ARM-Linux Python
> distribution ?
> (or is it safer to wait for industrial spec Intel Atom boards to avoid
> the cross compilation altogether ?
> 
> What would it take for the Linux version of Python to be easily cross
> compiled (i.e. would the Linux-Python maintainers be willing to
> include and maintain cross-compilation specific functions) ?

There are tickets and patches in the Python bug tracker for this, waiting
for people with enough time to review them. Here's a recent submission:

http://bugs.python.org/issue1006238

> Let's say we can get it done.
> How is the performance and stability of a working Python on an
> embedded ARM-Linux system ?

It seemed OK to me the last time I tried this, but then I used to use Python
on a non-Linux, 48MHz ARM system in the late 1990s and performance wasn't
really a serious problem then, either.

> Does cross compiling Python automatically include the standard Python
> library, or is that yet another adventure ?

Parts of it. I had problems with one or two modules, so I just excluded
them from the build.

David



More information about the Python-list mailing list