[Pythonmac-SIG] os x dynamic loading question

Gregory (Grisha) Trubetskoy grisha@modpython.org
Tue, 4 Jun 2002 15:10:09 -0400 (EDT)


May be someone here can give a clue to a not so OS X savvy.

I'm trying to build my development version of mod_python on OS X.

I build a mod_python.so using apache's apxs which is actually a wrapper
around libtool. The bottom line is that mod_python.so has libpython2.2.a
statically linked into it.

Apache has no problems starting and loading mod_python.so, but as soon as
any Python code tries to load a .so module (in my case it happens to be
"import time" for time.so), the interpreter says "Failure linking new
module".

After a small change to dynload_next.c, I was able to get the text of the
error that OS X reports, which is:

ld: ./httpd Undefined symbols:
/usr/local/lib/python2.2/lib-dynload/time.so undefined reference to
_PyArg_Parse expected to be defined in the executable
/usr/local/lib/python2.2/lib-dynload/time.so undefined reference to
_PyArg_ParseTuple expected to be defined in the executable
/usr/local/lib/python2.2/lib-dynload/time.so undefined reference to
_PyDict_GetItemString expected to be defined in the executable
/usr/local/lib/python2.2/lib-dynload/time.so undefined reference to
_PyDict_SetItemString expected to be defined in the executable
/usr/local/lib/python2.2/lib-dynload/time.so undefined reference to
_PyErr_NoMemory expected to be defined in the executable
/usr/local/lib/python2.2/lib-dynload/time.so undefined reference to
_PyErr_Occurred expected to be defined in the executable

etc....

Does anyone know what this means? Why can't ld see those symbols?

Thanks for any help,

Grisha