public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Should -Os imply -shared-libgcc?
@ 2004-11-29 19:59 Ian Lance Taylor
  2004-11-29 21:15 ` Paul Koning
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2004-11-29 19:59 UTC (permalink / raw)
  To: gcc

It occurred to me that on appropriate platforms, -shared-libgcc will
typically generate a slightly smaller program.  Does anybody have an
opinion on whether the use of -Os on the link line should imply
-shared-libgcc?

If we do that, it suggests that the linker should accept -Os on the
command line.  Right now gcc does not pass -O options to the linker,
although the GNU linker does accept them.  But those changes are a
separate issue.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Should -Os imply -shared-libgcc?
  2004-11-29 19:59 Should -Os imply -shared-libgcc? Ian Lance Taylor
@ 2004-11-29 21:15 ` Paul Koning
  2004-11-30 14:39   ` Dave Korn
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Koning @ 2004-11-29 21:15 UTC (permalink / raw)
  To: ian; +Cc: gcc

>>>>> "Ian" == Ian Lance Taylor <ian@airs.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Should -Os imply -shared-libgcc?
  2004-11-29 21:15 ` Paul Koning
@ 2004-11-30 14:39   ` Dave Korn
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Korn @ 2004-11-30 14:39 UTC (permalink / raw)
  To: 'Paul Koning', ian; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-30 13:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-29 19:59 Should -Os imply -shared-libgcc? Ian Lance Taylor
2004-11-29 21:15 ` Paul Koning
2004-11-30 14:39   ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).