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 21-Feb-2002, Alexandre Oliva <aoliva@redhat.com> 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?

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 <fjh@cs.mu.oz.au>  |  "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.


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