public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joe Buck <Joe.Buck@synopsys.COM>
To: Toon Moene <toon@moene.org>
Cc: Dave Korn <dave.korn.cygwin@gmail.com>,
	       "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Does `-fwhole-program' make sense when compiling shared libraries?
Date: Mon, 17 May 2010 18:24:00 -0000	[thread overview]
Message-ID: <20100517182340.GQ26047@synopsys.com> (raw)
In-Reply-To: <4BF1838B.2090603@moene.org>

On Mon, May 17, 2010 at 10:57:31AM -0700, Toon Moene wrote:
> On 05/17/2010 08:08 PM, Dave Korn wrote:
> >
> >      Hi!
> >
> >    PR42904 is a bug where, when compiling a windows DLL using -fwhole-program,
> > the compiler optimises away the entire library body, because there's no
> > dependency chain related to 'main' to anchor it.

Not a bug, but perhaps the beginning of a reasonable enhancement project.

> Aren't "shared library" and "whole program" mutually exclusive concepts ?
> 
> The mere fact that you are building a library means that it cannot be 
> the whole program, and because a shared library cannot be determined to 
> have being used by any fixed program, by definition cannot be "the whole 
> program".
> 
> Or so I'd think.

The concept would need to be extended so that the compiler would be told
exactly what interfaces of the shared library are considered free, and
which are considered internal calls.  Then a -fwhole-library could make
sense.

  reply	other threads:[~2010-05-17 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17 17:49 Dave Korn
2010-05-17 17:57 ` Toon Moene
2010-05-17 18:24   ` Joe Buck [this message]
2010-05-17 21:33     ` Jan Hubicka
     [not found]   ` <4BF18A6B.5030603@gmail.com>
2010-05-18 13:58     ` Dave Korn
2010-05-18 14:13       ` Jan Hubicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100517182340.GQ26047@synopsys.com \
    --to=joe.buck@synopsys.com \
    --cc=dave.korn.cygwin@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=toon@moene.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).