Python for android for L

212 views
Skip to first unread message

Santhoshkumar Palanisamy

unread,
Sep 23, 2014, 12:36:38 PM9/23/14
to python-fo...@googlegroups.com
Is python for android apk available for android L version?

张世军

unread,
Sep 24, 2014, 5:02:05 AM9/24/14
to python-fo...@googlegroups.com
I am trying now

Santhoshkumar Palanisamy

unread,
Sep 30, 2014, 11:19:04 AM9/30/14
to python-fo...@googlegroups.com
Any update on this?

张世军

unread,
Oct 21, 2014, 9:25:09 PM10/21/14
to python-fo...@googlegroups.com
After down the NDK-10c from the google android


/build/core/build-binary.mk:212:#ifneq (,$(filter true,$(NDK_APP_PIE) $(TARGET_PIE)))

211 # enable PIE for executable beyond certain API level, unless "-static"
212 #ifneq (,$(filter true,$(NDK_APP_PIE) $(TARGET_PIE)))
213 ifeq ($(call module-get-class,$(LOCAL_MODULE)),EXECUTABLE)
214 ifeq (,$(filter -static,$(TARGET_LDFLAGS) $(LOCAL_LDFLAGS) $(NDK_APP_LDFLAGS)))
215 LOCAL_CFLAGS += -fPIE
216 LOCAL_LDFLAGS += -fPIE -pie
217 endif
218 endif
219 #endif


I fix it , it is ok now

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/python_env/com.googlecode.pythonforandroid/files/python/lib:/data/python_env/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload:/data/python_env/extras/python


static int open_library(const char* name) {
719  TRACE("[ opening %s ]", name);
720
721  // If the name contains a slash, we should attempt to open it directly and not search the paths.
722  if (strchr(name, '/') != NULL) {
723    int fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_CLOEXEC));
724    if (fd != -1) {
725      return fd;
726    }
727    // ...but nvidia binary blobs (at least) rely on this behavior, so fall through for now.
728#if defined(__LP64__)
729    return -1;
730#endif
731  }
732
733  // Otherwise we try LD_LIBRARY_PATH first, and fall back to the built-in well known paths.
734  int fd = open_library_on_path(name, g_ld_library_paths);
735  if (fd == -1) {
736    fd = open_library_on_path(name, kDefaultLdPaths);
737  }
738  return fd;

91static const char* const kDefaultLdPaths[] = {
92#if defined(__LP64__)
93  "/vendor/lib64",
94  "/system/lib64",
95#else
96  "/vendor/lib",
97  "/system/lib",
98#endif
99  NULL
100};


in L, at runtime:LD_LIBRARY_PATH will be :/data/python_env/com.googlecode.pythonforandroid/files/python/lib:/data/python_env/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload:/data/python_env/extras/python

and some .so is available in both python/lib folder and system/lib/lib64 folder, such as libcrypto libssl, libsqlite, libexpact. For these .so files, python 32 bit process load them from python/lib is ok, But the system CHMOD/PS etc cmd invoke from .py now also load the .so inside python/lib, this is hardcoded and will not fallabck to kDefaultLdPaths. Now issue comming, since chmod/ps/etc in 64 bit L should load the 64bit, and in 32 bit L need load the 32 bit.


So the resolution is:

1. remove all .so files inside python/lib if it is also available in system. this have potential risk if python need the specific version
2. rename all .so files which is also available in system to XXX_Python.so in python lib, and in Python Src code to change their name in the system Load API and rebuild.





On Wednesday, September 24, 2014 12:36:38 AM UTC+8, Santhoshkumar Palanisamy wrote:
python_r16.rar

Anubhav Srivastava

unread,
Dec 2, 2014, 5:14:53 AM12/2/14
to python-fo...@googlegroups.com
Hi Changshijun,
As you were able to successfully build python executable with PIE
can you please share the same with us ?

Thanks a lot,
Anubhav
> --
> You received this message because you are subscribed to the Google Groups
> "Py4A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python-for-andr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

shijun

unread,
Dec 2, 2014, 8:29:47 PM12/2/14
to python-fo...@googlegroups.com
Yes, I sent the binary rar package.
You received this message because you are subscribed to a topic in the Google Groups "Py4A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-for-android/Jaf09EA82Ys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-for-andr...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages