public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Does `-fwhole-program' make sense when compiling shared libraries?
@ 2010-05-17 17:49 Dave Korn
  2010-05-17 17:57 ` Toon Moene
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Korn @ 2010-05-17 17:49 UTC (permalink / raw)
  To: gcc


    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.

  It's pointed out that we could perhaps resolve this by inferring attribute
externally_visible anywhere we see dllexport is applied, but I wondered
whether Linux (or any other target) does anything like this (perhaps based on
default visibility or explicit attributes?), or if you are just expected to
annotate all your externally-visible functions if you want to be able to
meaningfully combine -fwhole-program with -shared compilation?

    cheers,
      DaveK


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

end of thread, other threads:[~2010-05-18 14:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-17 17:49 Does `-fwhole-program' make sense when compiling shared libraries? Dave Korn
2010-05-17 17:57 ` Toon Moene
2010-05-17 18:24   ` Joe Buck
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

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