libstdc++ libtool lossage

Alexandre Oliva aoliva@redhat.com
Thu Feb 21 12:34:00 GMT 2002


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.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer



More information about the Gcc mailing list