This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -shared-libgcc vs. -static -static-libgcc
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 27 Feb 2002 21:43:34 -0300
- Subject: Re: -shared-libgcc vs. -static -static-libgcc
- Organization: GCC Team, Red Hat
- References: <200202260137.g1Q1bHQ15810@fillmore.constant.com>
On Feb 25, 2002, Benjamin Kosnik <bkoz@redhat.com> wrote:
> What is now CXX:
> /mnt/hd/ahimsa/bld-x86-gcc/gcc/g++ -shared-libgcc
> -B/mnt/hd/ahimsa/bld-x86-gcc/gcc/
> plus
> -static
> gives:
> /mnt/hd/ahimsa/H-x86-src/bin/ld: cannot find -lgcc_s
> collect2: ld returned 1 exit status
> Odd, methinks, but whatever.
Ouch.
> As it turns out, there is no way to flip CXX into a statically-linking
> compiler now:
Ok, I see the problem. I see 3 ways to fix it:
1) rework init_gcc_specs() again such that -static-libgcc overrides
-shared-libgcc in the absence of -shared, just like it does in the
presence of -shared
2) rework init_gcc_specs() such that -static alone overrides
-shared-libgcc, regardless of -shared
3) arrange for CXX to not be passed with -shared-libgcc to
libstdc++-v3 and libgcj, and get -shared-libgcc into CXX only for
libtool -shared configuration and shared-library creation.
> I've been trying to stay out of the whole libtool discussion. This
> behavior, however, it making me have second thoughts.
Don't even start. This has nothing to do with libtool. This is about
incompatible gcc flags.
Take libtool out of the picture and you'll realize that having
-shared-libgcc in CXX would give us just as much trouble.
I made the mistake of assuming that having -shared-libgcc in CXX was
going to be harmless for libstdc++-v3 and libgcj. It turned out to
not be that simple. So now I get to fix that up.
> Any hints on how -shared-libgcc can be reversed further down on the
> compile line?
I'll look into implementing all of the above, even though any one of
them would suffice. But I think having the 3 of them would make it
more consistent. Any disagreement?
--
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