Subject: Re: different behaviour of system cc and TOOLDIR/cc
To: matthew green <>
From: Richard Earnshaw <>
List: tech-toolchain
Date: 06/12/2003 15:05:02
>    Probably should be fixed, now that gcc3 builds a shared libgcc (see below).
> i know it has *something* to do with exception handling, but could
> someone please explain why we need to use libgcc_s for anything but
> c++ programs (and possible even there only those that need it?)
> programs linked against are from experience MUCH more
> likely to fail to run because it is missing than other random
> libraries... but when it's not needed for anything (what in the
> current system is broken with out it, for instance?) i think we
> should seriously consider avoiding it when possible.

To the best of my knowledge we don't (add libgcc_s) unless linking c++.

The specs entry from a gcc-3.3 build reads:

%{!shared:%{!symbolic: %{static|static-libgcc:-lgcc 
-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M

the g++ command adds -shared-libgcc as a link argument, gcc itself does