[Python-Dev] Extension on Solaris: ld -G or gcc -G?

Greg Ward gward@mems-exchange.org
Tue, 23 May 2000 22:49:23 -0400


My post on this from last week was met with a deafening silence, so I
will try to be short and to-the-point this time:

   Why are shared extensions on Solaris linked with "ld -G" instead of
   "gcc -G" when gcc is the compiler used to compile Python and
   extensions?

Is it historical?  Ie. did some versions of Solaris and/or gcc not do
the right thing here?  Could we detect that bogosity in "configure", and
only use "ld -G" if it's necessary, and use "gcc -G" by default?

The reason that using "ld -G" is the wrong thing is that libgcc.a is not
referenced when creating the .so file.  If the object code happens to
reference functions in libgcc.a that are not referenced anywhere in the
Python core, then importing the .so fails.  This happens if there is a
64-bit divide in the object code.  See my post of May 19 for details.

        Greg
-- 
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange / CNRI                           voice: +1-703-262-5376
Reston, Virginia, USA                            fax: +1-703-262-5367