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 Feb 23, 2002, David Edelsohn <dje@watson.ibm.com> wrote:

> 	The reason that "gcc -shared" did not link with the shared library
> on GNU/Linux is because config/linux.h defines

> #if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
> #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
> #endif

And that's precisely the intent of this flag.  As RTH and Jakub
explained, GNU/Linux doesn't need to link C shared libraries with
libgcc_s.so, as long as a sufficiently recent version of binutils is
in use.

The problem was that libstdc++-v3 and libjava, that are not C shared
libraries, use gcc, not g++ nor gcj, to create their libraries,
otherwise they'd have to be linked against themselves.  That's why
they have to use -shared-libgcc in addition to -shared.

> LINK_EH_SPEC affects whether "gcc -shared" links with -lgcc_s or
> libgcc.a.

As God intended :-)

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