[Mobile-sig] Python3 + stdlib on iOS, Android

Russell Keith-Magee russell at keith-magee.com
Tue Mar 24 01:01:50 CET 2015


On Mon, Mar 23, 2015 at 11:54 PM, Frank, Matthew I <
matthew.i.frank at intel.com> wrote:

> On 2015-03-23-10:40 CDT, π wrote
> > So far I have it working on OS X. I've copied the libpython into my
> project
> > directory and linked against it. I'm able to launch a Python interpreter,
> > use the C-API, etc.
> >
> > (Incidentally I've open-sourced my Python-C++ bridge here:
> > https://github.com/p-i-/PiCxx)
> >
> > I'm concerned about porting my project to iOS/Android in the future.
> >
> > The Kivy developers have successfully built Python2.x + stdlib for
> > iOS/Android.  They plan to eventually to also support 3.x, but it is not
> a
> > priority for them at the moment.
> >
> > And to my knowledge nobody else has successfully ported 3.x.
> >
> > Does anyone know otherwise?
>
> For iOS you should try Russ Magee's patch here:
> http://bugs.python.org/issue23670
>

One caveat that is mentioned in the ticket, but I'll repeat here for
clarity - the patch on that ticket doesn't work for ARMv7 processors at
present. There's a known bug preventing ctypes from  compiling on ARMv7.
However, it works on both the simulator and ARM64 devices, and the bug on
ARMv7 is a known quantity. There's no fundamental problem with ARMv7 - it's
just that you need to use a trunk version of libffi to get working ARM64
support, but that version is broken for ARMv7. If you use an older libffi,
you get working ARMv7, but break ARM64 support.

I've got a separate Github project to provide some build support tools -
see https://github.com/pybee/Python-iOS-support

As a side note - if anyone knows how to get hold of Anthony Green (the
libffi lead), or anyone else on the libffi team - I'd appreciate help in
contacting him. Every message I send to the libffi mailing list bounces off
their spam detector (sending from a normal Gmail account), and private
mails/twitter messages to Anthony have gone unanswered. Or, if someone
knows enough about x86 assembler to address [1]...

[1] https://github.com/atgreen/libffi/issues/181

Yours,
Russ Magee %-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/mobile-sig/attachments/20150324/29f1185f/attachment.html>


More information about the Mobile-sig mailing list