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


Sorry that it took me so long to see this message.  I've got a lot
behind in the GCC mailing list :-(

On Feb 17, 2002, Richard Henderson <rth@redhat.com> wrote:

> 	(3) Even if -shared-libgcc somehow made it through to
> 	    xgcc, libtool is overriding the logic and using
> 	    -nostdlibs and specifying -lgcc explicitly.

I've been looking a bit at the problem.  The reason libtool can use
-nostdlib is because it collects the object file names, flags and
libraries passed by GCC to the linker when doing a -shared link at
libtool configure time, and puts them in explicitly when linking a
shared library.  Now, why it fails to find -lgcc_s in the list of
flags passed to the linker escapes me.

The idea is to be able to look at libraries implicitly linked in, so
as to tell whether they're static or dynamic, i.e., whether they can
or can't be linked into other shared libraries (on platforms on which
it makes a difference).  Libtool could surely get rid of -nostdlib and
all this pre- and post-objects and libraries on platforms that can
safely link non-PIC code into static libraries, but nobody got to
implement it.

> We absolutely must get this fixed for gcc 3.1.  Will you
> help unravel this rat's nest?

Sure.  Which platform are we talking about, for a start?

> One of these days I'm going to make "gcc -shared"
> Just Work

As in dropping static libraries from the dependency list when they
happen to contain PDC that can't be added to shared libraries?  This
would be great!

> None of the runtime libraries distributed with gcc will ever be
> built with anything but gcc, so it is pointless to cater to some
> broken system's broken tools.

How about starting with Solaris?  g++ -shared will fail if you build
and install GCC without a shared libstdc++.  You have to use
-mimpure-text to get the link to succeed.  This was actually the main
reason that motivated the complicated hack above.

-- 
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


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