Should -Os imply -shared-libgcc?

Dave Korn dk@artimi.com
Tue Nov 30 14:39:00 GMT 2004


> -----Original Message-----
> From: gcc-owner On Behalf Of Paul Koning
> Sent: 29 November 2004 20:20

> >>>>> "Ian" == Ian Lance Taylor writes:
> 
>  Ian> It occurred to me that on appropriate platforms, -shared-libgcc
>  Ian> will typically generate a slightly smaller program.  Does
>  Ian> anybody have an opinion on whether the use of -Os on the link
>  Ian> line should imply -shared-libgcc?
> 
> It should not.
> 
> Using shared libraries helps total memory usage if there are enough
> processes using the library in question.  If only one or two use the
> library, then shared libraries hurt overall memory usage.  Where
> exactly the breakeven point is depends on which library functions are
> actually used by given applications.
> 
> I've been through this in an embedded system optimization exercise...
> 
>      paul

  I'd add that really the decision to use shared libraries or not is
dependent on so many other factors related to the target system and the
intended installation and usage of the compiled application, that it should
be orthogonal to the decision of whether to optimise the build or not.


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Gcc mailing list