This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Should -Os imply -shared-libgcc?
- From: "Dave Korn" <dk at artimi dot com>
- To: "'Paul Koning'" <pkoning at equallogic dot com>,<ian at airs dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 30 Nov 2004 13:41:51 -0000
- Subject: RE: Should -Os imply -shared-libgcc?
> -----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....