From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117705 invoked by alias); 3 Dec 2018 00:37:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 117655 invoked by uid 89); 3 Dec 2018 00:37:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_COUK,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=mandate, exports, vtable, trim X-HELO: smtp1.wavenetuk.net Received: from smtp1.wavenetuk.net (HELO smtp1.wavenetuk.net) (195.26.36.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Dec 2018 00:37:15 +0000 Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id 95CFF12016FA; Mon, 3 Dec 2018 00:37:12 +0000 (GMT) From: Iain Sandoe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [Darwin] Fix build warnings for libstdc++ [NFC] Message-Id: <33F6DDD7-3914-4A04-9F43-0411A46A206E@sandoe.co.uk> Date: Mon, 03 Dec 2018 00:37:00 -0000 Cc: Jonathan Wakely To: libstdc++ , GCC-patches X-SW-Source: 2018-12/txt/msg00054.txt.bz2 Hi, GCC does not export construction vtable symbols from shared libraries**. The symbols are marked hidden in the objects; for Darwin that makes them al= so external (=E2=80=9Cprivate_extern=E2=80=9D is Darwin=E2=80=99s hidden) w= hich means that they show up in the list of possible symbols for export fro= m libstdc++, and there are sufficiently relaxed match conditions that they = reach the exports list. When Darwin=E2=80=99s static linker encounters th= em it generates a warning that they cannot be exported. This patch prunes = them from the list of symbols to be considered, thus eliminating the warnin= gs. OK for trunk? Iain ** This seems a design decision, rather than an ABI mandate - note that, o= n Darwin at least, these symbols *are* visible in libc++. libstdc++-v3/ * scripts/make_exports.pl (check names): Don=E2=80=99t try to export const= ruction vtable symbols. diff --git a/libstdc++-v3/scripts/make_exports.pl b/libstdc++-v3/scripts/ma= ke_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 () { # Ignore undefined and local symbols. next if (/^([^ ]+) [Ua-z] /); =20 + # 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.*$/); +