Vladimir Marangozov fixes an AIX-specific problem, writing:
""" Following up Robin Dunn's troubles with freeze, here's a patch that fixes an oddity regarding the import logic of shared modules on AIX. Symbol resolution of shared modules is now handled properly for the cases when the python library is linked to a binary with an arbitrary name. This includes the standard python[version] executable, but also applications that are embedding the python core (i.e. linked with libpython[version].a, the latter being static or shared). """
This commit is contained in:
parent
58c5a2a53c
commit
933c91ebcf
|
@ -898,6 +898,7 @@ aix_getoldmodules(modlistptr)
|
||||||
register char *ldibuf;
|
register char *ldibuf;
|
||||||
register int errflag, bufsize = 1024;
|
register int errflag, bufsize = 1024;
|
||||||
register unsigned int offset;
|
register unsigned int offset;
|
||||||
|
char *progname = Py_GetProgramName();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
-- Get the list of loaded modules into ld_info structures.
|
-- Get the list of loaded modules into ld_info structures.
|
||||||
|
@ -925,11 +926,13 @@ aix_getoldmodules(modlistptr)
|
||||||
ldiptr = (struct ld_info *)ldibuf;
|
ldiptr = (struct ld_info *)ldibuf;
|
||||||
prevmodptr = NULL;
|
prevmodptr = NULL;
|
||||||
do {
|
do {
|
||||||
if (strstr(ldiptr->ldinfo_filename, "python") == NULL) {
|
if (strstr(progname, ldiptr->ldinfo_filename) == NULL &&
|
||||||
|
strstr(ldiptr->ldinfo_filename, "python") == NULL) {
|
||||||
/*
|
/*
|
||||||
-- Extract only the modules containing "python" as a
|
-- Extract only the modules belonging to the main
|
||||||
-- substring, like the "python[version]" executable or
|
-- executable + those containing "python" as a
|
||||||
-- "libpython[version].a" in case python is embedded.
|
-- substring (like the "python[version]" binary or
|
||||||
|
-- "libpython[version].a" in case it's a shared lib).
|
||||||
*/
|
*/
|
||||||
offset = (unsigned int)ldiptr->ldinfo_next;
|
offset = (unsigned int)ldiptr->ldinfo_next;
|
||||||
ldiptr = (struct ld_info *)((unsigned int)
|
ldiptr = (struct ld_info *)((unsigned int)
|
||||||
|
|
Loading…
Reference in New Issue