cross-compiling python: reviewers needed

David Boddie david at boddie.org.uk
Wed Dec 20 10:48:48 EST 2006


Han-Wen Nienhuys wrote:

> I have a small patch for Python SVN that makes it possible to
> cross-compile python on Unix to various other Unix targets.
> I have successfully built a binary for FreeBSD on Linux.
>
> The patch is available at
> https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1597850&group_id=5470
>
> (file cross.patch)
>
> but it awaits further review.
>
> I'm looking for people willing to try this out, and give further
> review to the patch, so it may be applied to SVN.
>
> All you need is a bit of time, and experience in cross-compiling.

For various reasons, I don't have the time or resources to really look
at your patch in any detail. I was only able to quickly look through it
and see how you did certain things, such as specifying a Python build
interpreter and splitting up pgen's build rules. I modified the build
system in a similar way, so it was reassuring to see similar solutions.

Some comments:

I noticed that you define a CROSS_COMPILING environment variable so
that you know when to use the right tools. Is this a standard variable
name in other projects that allow cross-compilation?

You rely on an existing Python installation on the build machine.
Does this influence the configuration process, or the availability of
non-pure Python extension modules?

Does the configuration process still cause the tests to be built for
the build machine? This seems like a redundant step: ideally, the
tests would be run on the target machine in a separate step.


The above points are only observations, though. The patch looks like a
good first step towards a more configurable build system for Python.
It would be even better if, in the future, separate patches could
enable custom builds as well. This would, for example, allow minimal
Python distributions to be made by stripping out lots of modules that
are unavailable or unsuitable for use on embedded hardware.

David




More information about the Python-list mailing list