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.