public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Iain Sandoe <iain@sandoe.co.uk>
Cc: libstdc++ <libstdc++@gcc.gnu.org>,	GCC-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Darwin] Fix build warnings for libstdc++ [NFC]
Date: Mon, 03 Dec 2018 14:25:00 -0000	[thread overview]
Message-ID: <20181203142555.GA809@redhat.com> (raw)
In-Reply-To: <33F6DDD7-3914-4A04-9F43-0411A46A206E@sandoe.co.uk>

On 03/12/18 00:37 +0000, Iain Sandoe wrote:
>Hi,
>
>GCC does not export construction vtable symbols from shared libraries**.
>
>The symbols are marked hidden in the objects; for Darwin that makes them also external (“private_extern” is Darwin’s hidden) which means that they show up in the list of possible symbols for export from libstdc++, and there are sufficiently relaxed match conditions that they reach the exports list.   When Darwin’s static linker encounters them it generates a warning that they cannot be exported.  This patch prunes them from the list of symbols to be considered, thus eliminating the warnings.
>
>OK for trunk?

Yes, OK.

>Iain
>
>**  This seems a design decision, rather than an ABI mandate - note that, on Darwin at least, these symbols *are* visible in libc++.
>
>libstdc++-v3/
>
>	* scripts/make_exports.pl (check names): Don’t try to export construction
>	vtable symbols.
>
>
>diff --git a/libstdc++-v3/scripts/make_exports.pl b/libstdc++-v3/scripts/make_exports.pl
>index 7c9e4e31d4..93100e17dd 100644
>--- a/libstdc++-v3/scripts/make_exports.pl
>+++ b/libstdc++-v3/scripts/make_exports.pl
>@@ -103,6 +103,14 @@ NAME: while (<NM>) {
>     # Ignore undefined and local symbols.
>     next if (/^([^ ]+) [Ua-z] /);
>
>+    # GCC does not export construction vtables from shared libraries.
>+    # However the symbols are marked hidden, for Darwin that makes them
>+    # also external "private_extern", which means that they show up in
>+    # this list.  When ld64 encounters them it generates a warning that
>+    # they cannot be exported, so trim them from the set now.
>+    next if (/^construction vtable.*$/);
>+    next if (/^__ZTC.*$/);
>+
>

      reply	other threads:[~2018-12-03 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  0:37 Iain Sandoe
2018-12-03 14:25 ` Jonathan Wakely [this message]

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=20181203142555.GA809@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    --cc=libstdc++@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).