Deal with -lgcc -lc dependencies

Alexandre Oliva aoliva@redhat.com
Fri Apr 5 01:25:00 GMT 2002


On Apr  5, 2002, Jakub Jelinek <jakub@redhat.com> wrote:

> On Thu, Apr 04, 2002 at 03:06:53PM -0800, Richard Henderson wrote:
>> On Thu, Apr 04, 2002 at 06:01:46PM -0500, Jakub Jelinek wrote:
>> > But this is for static libc only, so shouldn't we really use (3.2 material):
>> > %{static:-lgcc -lc -lgcc -lc}%{!static:-lc -lgcc -lc_nonshared}
>> 
>> For 3.2, we want  "-( -lgcc -lc -)", which additionally can help
>> libtool.  (Refer to the rationale for the change Alex recently
>> tried to make to -lgcc linkage for details.)

> Shouldn't this be rather -( -lc -lgcc -) then, so that on arches where
> shared libc provides symbols which are also in libgcc the ones from
> libc are used?

What if -lgcc has newer definitions of functions with features that a
newer GCC actually depends on?  Taking them from libc wouldn't work.
I think it's safer to have -lgcc first, even if this means we won't
share some symbols.

Ideally, GCC should test whether there's any symbol it libgcc with
recent it cares about that are not present in libc, and order -lgcc
and -lc accordingly.  But this would be nearly impossible to do
properly, so I'd rather take the safer and simpler route.

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



More information about the Gcc-patches mailing list