Feature #1323
closedInclude Python static libraries to build Python-C extensions with static linking
100%
Description
Currently Python 2.7/3.5 in CrystaX NDK include only shared Python libs libpythonX.X.so. I'd like to be able to build Python-C statically-linked extensions with no external dependencies. Please include static libs libpythonX.X.a as well.
Updated by Dmitry M. over 8 years ago
Yes, we've thought about it. There was several issues preventing us from doing that initially, but you're right, this is useful feature so we'd make it. I just can't promise it would be soon.
Updated by Dmitry M. over 8 years ago
- Status changed from Open to In Progress
- Assignee changed from Dmitry M. to Vitaly M.
Updated by Vitaly M. over 8 years ago
step-1)
In order to have full control over static python libraries and more over to be able to play with python byte-code in any games,
first of all we need to have host pythons of the same major versions as we already have for target - python2.7 and python3.5
This task is almost done - remaining part https://tracker.crystax.net/issues/1354
step-2)
Build target python core as static library.
This static is expected to self-consistent but with one external symbol - struct _frozen PyImport_FrozenModules[]
step-3)
Now we can play with content of PyImport_FrozenModules[] and provide different levels of frozen modules:
- level-0) Absolute minimal content for PyImport_FrozenModules - means you need nothing except static python core
- level-1) Full content for PyImport_FrozenModules - means you have full access to python stdlib prebuilt as bytecode
- level-2) Custom content for PyImport_FrozenModules - nearly the same what different freezing toools do (like cx_Freeze or others)
Updated by Vitaly M. over 8 years ago
Custom content for PyImport_FrozenModules
To make sure that everything works well here I decided to compile a completely static python interpreter without depends on any dynamic libraries. In this interpreter PyImport_FrozenModules list is filled full python-stdlib being frozen as byte-code.
Actual python-freezing tool adapted for CrystaX can be implemented lately when it is really needed - not as a part of this task.
Updated by Vitaly M. over 8 years ago
pull request: https://github.com/crystax/android-platform-ndk/pull/3
Updated by Vitaly M. over 8 years ago
- Status changed from In Progress to 3
- % Done changed from 0 to 100