-
Notifications
You must be signed in to change notification settings - Fork 280
Description
I've been cross compiling python for Android across a number of NDK releases. It was originally done with GCC and NDK 10 I believe. Slowly, I have converted it to build with clang, but when this happens not all of my python modules are built.
Here is my project and the clang branch https://github.com/GRRedWings/python3-android/tree/clang
I am trying to build against Python 3.5.1. With this, I have the project so that I can compile and get the Shared Library output, but in doing so a number of the modules that are part of the project are not created. As an example, the _socket module is not created. Nothing in the build output seems to indicate that anything failed though.
When I look at the output, I have the Shared Library that I would expect (libpython3.5m.so), and I have the Python folder with all of the required *.py files. But when I look at the output lib-dynload folder, only a small subset of the *.so files are there. And as soon as I try to run with this, I get that the socket module is missing.
I'm not sure if this is something in the makefile, if there is some sort of pre-build step that I am not doing correctly in order to have the makefile generated properly. I've spent a great deal of time on this, and I'm wondering if it's possible that there is something in the NDK build chain that is not being done properly.
I'm learning on the fly about makefiles and cross compiling, but is there any way to know if the issue is with something I have done vs the NDK not doing something properly? I don't understand how the modules to build are chosen, or how to troubleshoot these missing ones.
After talking with Dan & Elliott at their IO session, I'm hopeful that you might be able to give a little bit of insight.
Environment Details
I'm building this on an Unbutu 16.04 LTS
NDK_REV=19c
SDK_REV=25.2.4
ANDROID_API_LEVEL=22
ANDROID_PLATFORM=arm64
ANDROID_COMPILER=4.9