python interpreter binary for x86 android

72 views
Skip to first unread message

Jian Sun

unread,
Sep 28, 2016, 2:14:04 AM9/28/16
to crystax-ndk
Hi there,

I would like to use the python interpreter bundled by the crystax-ndk directly on an x86-based Android device. Could someone tell me where can I find the prebuilt binary?

Thanks!
Sun

Dmitry Moskalchuk

unread,
Sep 28, 2016, 2:18:24 AM9/28/16
to cryst...@googlegroups.com
Hello,

Look to the folder $NDK/sources/python/$PYTHON_VERSION/shared/$ABI (for example, $NDK/sources/python/3.5/shared/armeabi-v7a). You'd find there python binary (python.bin), tiny shell wrapper (python), main library (libs/libpython3.5m.so), python modules (modules) and zipped python standard library (stdlib.zip).

-- 
Dmitry Moskalchuk
--
You received this message because you are subscribed to the Google Groups "crystax-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crystax-ndk...@googlegroups.com.
To post to this group, send email to cryst...@googlegroups.com.
Visit this group at https://groups.google.com/group/crystax-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/crystax-ndk/8188a231-fcd0-4f3f-a797-85dd3ad431e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jian Sun

unread,
Sep 28, 2016, 10:58:33 PM9/28/16
to crystax-ndk
Thanks! However I got the following error when trying to execute the python wrapper:

127|root@generic_x86:/data/python/x86 # ./python
error: only position independent executables (PIE) are supported.

I am using an emulator with Android 6.0 API level 23.

It looks like we need to have -fPIE and -pie flags set when building python? Does it mean the prebuilt python won't work for Android 5.0 and above?

Regards,
Sun

Jian Sun

unread,
Sep 29, 2016, 4:24:36 AM9/29/16
to crystax-ndk
Okay I need to learn to search harder :)

Apparently this has been fixed a month ago https://tracker.crystax.net/issues/1486

Downloading the build and trying...

Jian Sun

unread,
Sep 29, 2016, 10:08:18 PM9/29/16
to crystax-ndk
This is what I tried and observed:

1. I pushed everything from sources\python\3.5\shared\x86 to device. Did chmod a+x.
2. When I execute ./python, it complains unable to find libcrystax.so
3. I pushed libcrystax.so from sources\crystax\libs\x86 to the python libs directory (side by side with libpython3.5m.so)
4. ./python now gives segmentation fault.

Anything I am missing here?

Regards,
Sun

Jian Sun

unread,
Oct 3, 2016, 1:52:44 AM10/3/16
to crystax-ndk
Any pointers?
Reply all
Reply to author
Forward
0 new messages