bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: g++/GNU ld/position independent libraries


From: Jason Merrill
Subject: Re: g++/GNU ld/position independent libraries
Date: Fri, 18 Jan 2002 12:56:41 +0000
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

>>>>> "Bill" == Bill Hoffman <address@hidden> writes:

> At 12:39 PM 1/18/2002 +0000, Jason Merrill wrote:
>>>>>>> "William" == William A Hoffman <address@hidden> writes:
>> 
>>> At 10:47 AM 1/18/2002 +0000, Jason Merrill wrote:
>>>> GCC shared libraries should always be built with gcc -shared.  -nostdlib is
>>>> wrong.
>> 
>>> OK, I'll bite, how should they be built?  I guess you would have to figure
>>> out if the libstdc++ was built shared or
>>> not then add or remove the -nostdlib?   If libstdc++ is built static then
>>> you have to have the -nostdlib.
>> 
>> Why?  The gcc driver doesn't link against libstdc++.

> But for linking c++, I thought you should use the c++ driver.
> c++ -shared -o libfoo.so foo.o

> In previous versions of gcc, if you did this:
> gcc -shared -o libfoo.so foo.o

> Globals would not be initialized properly, (no constructor calls)

> At what version of gcc did that stop happening?

The gcc and c++ drivers have never been different in that respect; the only
differences are that the c++ driver treats .c files as C++ and links against
libstdc++.

Jason



reply via email to

[Prev in Thread] Current Thread [Next in Thread]