[Python-Dev] Anders Qvist: Re: [snake-farm] Autodetect /usr/ccs/bin?

Martin v. Loewis martin@v.loewis.de
06 Oct 2002 23:23:28 +0200


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

> Apparently, the pike people do this. They seem to think it's the right
> thing to do. From their configure.in:
> 
>   case "$pike_cv_sys_os" in
>     ...
>     Solaris) LDSHARED="/usr/ccs/bin/ld -G";;
>     ...
> 
> They also add it to their PATH during various circumstances. Have a
> look at:

Using ld directly is wrong because it fails to add implicit linker
options, in particular crt*.o. For example, on SCO, giving -Kpthread
to the compiler implies giving -lpthread -l<some funny library that
you cannot guess> to the linker.

Likewise, using gcc on Solaris, linking with gcc implies linking
crtbegin.o and crtend.o, which is necessary to run constructors of
global C++ objects. The same holds for SunPR, which implicitly links
crti.o, crt1.o, values-xa.o, and crtn.o for an executable, and crti.o,
values-xa.o, and crtn.o for a shared object.

Regards,
Martin