8b2694efb7
* fix build for openssl 1.1.1b required for sdk (cherry picked from commit aa49e3b2755b97b6331cdbbb89efc954de8d5977) * use js code from master * fix openssl recipe and tweak build (cherry picked from commit 6e94c27021c7bd7b1e880c2fc314850e36a5a38e) * remove unused build recipes (cherry picked from commit f5c0577bdb175bfc0990602936bbc9e2052e1f25)
50 lines
1.4 KiB
Diff
50 lines
1.4 KiB
Diff
--- Python-2.7.2.orig/Python/dynload_shlib.c 2010-05-09 16:46:46.000000000 +0200
|
|
+++ Python-2.7.2/Python/dynload_shlib.c 2011-04-20 17:52:12.000000000 +0200
|
|
@@ -6,6 +6,7 @@
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
+#include <stdlib.h>
|
|
|
|
#if defined(__NetBSD__)
|
|
#include <sys/param.h>
|
|
@@ -75,6 +76,21 @@
|
|
char pathbuf[260];
|
|
int dlopenflags=0;
|
|
|
|
+ static void *libpymodules = -1;
|
|
+ void *rv = NULL;
|
|
+
|
|
+ /* Ensure we have access to libpymodules. */
|
|
+ if (libpymodules == -1) {
|
|
+ printf("ANDROID_UNPACK = %s\n", getenv("ANDROID_UNPACK"));
|
|
+ PyOS_snprintf(pathbuf, sizeof(pathbuf), "%s/libpymodules.so", getenv("ANDROID_UNPACK"));
|
|
+ libpymodules = dlopen(pathbuf, RTLD_NOW);
|
|
+
|
|
+ if (libpymodules == NULL) {
|
|
+ //abort();
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
if (strchr(pathname, '/') == NULL) {
|
|
/* Prefix bare filename with "./" */
|
|
PyOS_snprintf(pathbuf, sizeof(pathbuf), "./%-.255s", pathname);
|
|
@@ -84,6 +100,17 @@
|
|
PyOS_snprintf(funcname, sizeof(funcname),
|
|
LEAD_UNDERSCORE "init%.200s", shortname);
|
|
|
|
+
|
|
+ /* Read symbols that have been linked into the main binary. */
|
|
+
|
|
+ if (libpymodules) {
|
|
+ rv = dlsym(libpymodules, funcname);
|
|
+ if (rv != NULL) {
|
|
+ return rv;
|
|
+ }
|
|
+ }
|
|
+
|
|
+
|
|
if (fp != NULL) {
|
|
int i;
|
|
struct stat statb;
|