Subject: Re: C++ q: constructors not called for classes in shared lib ?
To: None <thorpej@nas.nasa.gov>
From: Jaromir Dolecek <dolecek@ics.muni.cz>
List: current-users
Date: 02/04/1999 16:00:48
Jason Thorpe wrote:
>  > What about pkglibtool, shouldn't at least _it_ be aware of this
>  > speciality and handle building c++ shared libs without any extra
>  > efford ?
> 
> How does pkglibtool know it's making a shared library out of C++ objects?

It does know when it's linking a shared library, which is enough.
Actually, for FreeBSD 2.2 there is such a hack in there.
The comments for FreeBSD 3.0 say it's not needed anymore, it's done
automagically there.

I filled a pr pkg/6935 with patch to pkglibtool so that it
adds /usr/lib/c++rt0.o to list of objects when linking shared
library on a.out systems and the file is available. It has worked
perfectly for my little tests :)

I think it's not a problem it's linking the object in even for C
shared libraries -- it's only 500B on i386 and it's much easier
solution than to try to change build process of each and every C++
package around or guess if we are linking C++ code.

IMHO it would be nice to change ld to link it in autimatically.
Or other way around -- I see no good reason for NOT doing so.
Pros are obvious :)

-- 
Jaromir Dolecek <dolecek@ics.muni.cz>	http://www.ics.muni.cz/~dolecek/
-------------------------------------------------------------------------
It is better never to have been born.  But who among us has such luck?
One in a million, perhaps.