This is the mail archive of the
mailing list for the GCC project.
Re: libstdc++ libtool lossage
On 21-Feb-2002, Alexandre Oliva <email@example.com> wrote:
> On Feb 21, 2002, Richard Henderson <firstname.lastname@example.org> 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
Using -lgcc_s is not safe; it has dangers of its own. In particular,
it introduces a dependency on a shared library which might not be
present on the machine where the final executable will get installed.
There are also some potential versioning issues that might arise in
the future (e.g. the program may refer to symbols from libgcc that are
only present in a new version of libgcc, but get installed on a system
that only has the old version of libgcc around).
Of course, package management systems may suffice to address those issues,
but not everyone uses those, and we don't want to force everyone to do so...
Fergus Henderson <email@example.com> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.