public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dave Korn <dave.korn.cygwin@gmail.com>
To: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Does `-fwhole-program' make sense when compiling shared libraries?
Date: Mon, 17 May 2010 17:49:00 -0000	[thread overview]
Message-ID: <4BF1861F.5020406@gmail.com> (raw)


    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


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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17 17:49 Dave Korn [this message]
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

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=4BF1861F.5020406@gmail.com \
    --to=dave.korn.cygwin@gmail.com \
    --cc=gcc@gcc.gnu.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).