This is the mail archive of the 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: -shared-libgcc vs. -static -static-libgcc

On Feb 25, 2002, Benjamin Kosnik <> 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. 


> 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
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
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]