This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++ libtool lossage


On Thu, Feb 21, 2002 at 05:30:51PM -0300, Alexandre Oliva wrote:
> On Feb 21, 2002, Richard Henderson <rth@redhat.com> wrote:
> 
> > 	gcc -shared			# -lgcc
> > 	gcc -shared -shared-libgcc	# -lgcc_s
> > 	g++ -shared			# -lstdc++ -lgcc_s
> 
> There's something I dislike very much about this design.
> 
> Earlier, it was perfectly ok to use gcc to link multi-language
> applications and shared libraries, as long as the appropriate
> language-specific libraries were explicitly linked in.
> 
> Now, doing so is harmful, and one has to remember to use
> -shared-libgcc in order to avoid the very problem that libstdc++-v3
> and libjava have run into.
> 
> Since linking with -lgcc instead of -lgcc_s is an optimization (I
> suppose), wouldn't it be reasonable to use the safe construct by
> default (-lgcc_s), and the static libgcc only if explicitly requested
> so?
> 
> I understand this wouldn't give as much benefit for C applications as
> intended, but it appears to me that it would help all packages that
> build C++ shared libraries out there, especially those that use
> libtool.

So you want to punish all C shared libraries just because some people aren't
able to use proper gcc driver (g++) to link C++ shared libraries?
Furthermore, even if they link with gcc -shared but add -lstdc++ (shared)
in and libstdc++.so was linked against -lgcc_s, they will use shared
libgcc_s. But I have seen far too many packages which linked C++ shared libs
with gcc driver and have not added -lstdc++ at all, so I think using g++ for
now should be strongly encouraged.

I hope 3.2 gcc driver will have options for all languages which made it
to the link as has been suggested (and g++ or gcj would just add one
implicit one to the others) to finally support multi-language links,
so this will be a non-issue then.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]