* [Darwin] Fix build warnings for libstdc++ [NFC]
@ 2018-12-03 0:37 Iain Sandoe
2018-12-03 14:25 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2018-12-03 0:37 UTC (permalink / raw)
To: libstdc++, GCC-patches; +Cc: Jonathan Wakely
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?
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.*$/);
+
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Darwin] Fix build warnings for libstdc++ [NFC]
2018-12-03 0:37 [Darwin] Fix build warnings for libstdc++ [NFC] Iain Sandoe
@ 2018-12-03 14:25 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2018-12-03 14:25 UTC (permalink / raw)
To: Iain Sandoe; +Cc: libstdc++, GCC-patches
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.*$/);
>+
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-03 14:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-03 0:37 [Darwin] Fix build warnings for libstdc++ [NFC] Iain Sandoe
2018-12-03 14:25 ` Jonathan Wakely
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).