1 --- Python-2.7.6/Lib/distutils/command/build_ext.py.~1~ 2013-11-09 23:36:40.000000000 -0800
2 +++ Python-2.7.6/Lib/distutils/command/build_ext.py 2014-05-14 12:47:04.342901439 -0700
4 filename = self.get_ext_filename(ext_name)
5 filename = os.path.split(filename)[-1]
7 + # on Solaris we put 64-bit python objects under .../64
8 + if sys.maxint != 2147483647L:
9 + filename = os.path.join("64", filename)
12 # no further work needed
15 so_ext = get_config_var('SO')
16 if os.name == 'nt' and self.debug:
17 return os.path.join(*ext_path) + '_d' + so_ext
18 - return os.path.join(*ext_path) + so_ext
19 + #return os.path.join(*ext_path) + so_ext
20 + # .so extensions are word-size specific
21 + path = apply(os.path.join, ext_path)
22 + if sys.maxint == 2147483647L:
23 + return path + so_ext
24 + dirname = os.path.dirname(path);
25 + basename = os.path.basename(path);
26 + return os.path.join(dirname, "64", basename + so_ext)
28 def get_export_symbols (self, ext):
29 """Return the list of symbols that a shared extension has to
30 --- Python-2.7.6/Python/import.c.~1~ 2013-11-09 23:36:41.000000000 -0800
31 +++ Python-2.7.6/Python/import.c 2014-05-14 12:53:34.233016586 -0700
32 @@ -1288,6 +1288,57 @@
33 static int find_init_module(char *); /* Forward */
34 static struct filedescr importhookdescr = {"", "", IMP_HOOK};
38 +insert_64dir(char *buf, size_t buflen)
44 + if ((blen = strlen(buf)) == 0)
47 + cp = &buf[blen - 1];
48 + while (cp != buf && *cp != SEP)
54 + if (blen + strlen("64/") + 1 >= buflen)
58 + sprintf(cp, "64%c%s", SEP, base);
65 + * If we're on a 64-bit platform, modify lookups for shared object files.
67 +static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
69 + struct stat statbuf;
71 + if (sizeof(void *) != 8)
74 + if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
77 + if (fdp->type != C_EXTENSION)
80 + if (insert_64dir(buf, buflen) == NULL)
83 + return strlen("64/");
87 static struct filedescr *
88 find_module(char *fullname, char *subname, PyObject *path, char *buf,
89 size_t buflen, FILE **p_fp, PyObject **p_loader)
90 @@ -1302,11 +1353,10 @@
91 static struct filedescr fd_builtin = {"", "", C_BUILTIN};
92 static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
94 -#if defined(PYOS_OS2)
97 char *saved_buf = NULL;
100 if (p_loader != NULL)
103 @@ -1513,15 +1563,17 @@
107 -#if defined(PYOS_OS2)
108 /* take a snapshot of the module spec for restoration
109 * after the 8 character DLL hackery
111 saved_buf = strdup(buf);
113 saved_namelen = namelen;
114 -#endif /* PYOS_OS2 */
116 for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
118 + len += modify_path(fdp, buf, buflen);
120 #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
121 /* OS/2 limits DLLs to 8 character names (w/o
123 @@ -1562,21 +1614,20 @@
127 -#if defined(PYOS_OS2)
129 /* restore the saved snapshot */
130 strcpy(buf, saved_buf);
132 namelen = saved_namelen;
135 -#if defined(PYOS_OS2)
137 /* don't need/want the module name snapshot anymore */
148 --- Python-2.7.1/Python/importdl.h.orig Fri Jul 15 15:48:16 2011
149 +++ Python-2.7.1/Python/importdl.h Fri Jul 15 15:49:10 2011
151 extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
154 -/* Max length of module suffix searched for -- accommodates "module.slb" */
155 -#define MAXSUFFIXSIZE 12
156 +/* Max length of module suffix searched for -- accommodates "module.slb"
158 +#define MAXSUFFIXSIZE 15