C++ extension module crashes on Solaris

Steven E. Harris sharris at nospam.primus.com
Sun May 21 22:22:59 EDT 2000


Guido van Rossum <guido at python.org> writes:

> It seems your shared library module doesn't see the symbols defined by
> the Python main app.  Normally, these are being exported by default.
> I wonder if the trick of using g++ for the linker breaks this?

Yes, that turned out the to be the problem. I will take some time on
Monday to prepare a more complete summary of what I learned (based
upon _lots_ of helpful contributions), but to summarize:

* Python must be linked with the option '-Wl,-E' passed to the linker.
  (That is, on Solaris, using g++, with the GNU binutils package.)

Other advice involving compiling the extension with '-fPIC' also
seemed relevant, but turned out to not make any difference. Now I'm
not sure why '-fPIC' _isn't_ required!

-- 
Steven E. Harris
Primus Knowledge Solutions, Inc.
http://www.primus.com



More information about the Python-list mailing list