Message ID | 20221224113525.20201-1-iain@sandoe.co.uk |
---|---|
State | Committed |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02B66384E786 for <patchwork@sourceware.org>; Sat, 24 Dec 2022 11:35:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02B66384E786 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671881758; bh=bA7uyOrHMHGbo0WRZoNSrI+TrU3MNqr+XYX5BXxYF6Q=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=gMkKvwyRFpJeE+1qb7NB7WChC9zMmTqin3xCeA6vqmG0tFO230gyA0cdzobploWLx ixzTY9d1uZg4MP1mwI86mvL8uW8sx9URUDrjphjFUtpyAi997jEXLSnOAKnlnpJ2/2 lkoytcWae6B8cbs5qUkDb6Fgu+LVX1BrcZk9Ck5g= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id E05F33858D1E; Sat, 24 Dec 2022 11:35:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E05F33858D1E Received: by mail-wr1-x433.google.com with SMTP id w15so6609671wrl.9; Sat, 24 Dec 2022 03:35:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bA7uyOrHMHGbo0WRZoNSrI+TrU3MNqr+XYX5BXxYF6Q=; b=f/9dUC8uPwiq4tkJllib72jaW2mrj4kA3cQlg3WxV+iXzaS8sfsCdhy2RoLz0Hzre2 QqXKgGC5u0RgebXiZ5TgrRlrM4FDrMDFAbwmZJfqy+zpOGI77sy/6JZao/ktY7pS/zXp rslbSlbDMfV8Rb7HGNt0oAwekvBFQLHQ73YmitSyYIE6foB1FoC7CPPvMV8LNvEnM7PQ nEBInV/7ZaL2sWTS2AKL0m9GobVwmjtV1N8gIhBXw9Os2P2Gdw6s8+PTKDlElQsj8NW9 8yw4RUJUXdGGWJf7Ap1k1gqGpRVvJpvZSTF36kwEv2LKI5/WKp7aDn7PcZ/Y/R31jepN wrhA== X-Gm-Message-State: AFqh2kqRIisILTeYMbUuZW74c20pAp3s9b55Zma2J3l9gmFkEXHK5VEe R2yjPJ9MZ+pbHySJrkHeNLQ8hfCMV+k= X-Google-Smtp-Source: AMrXdXuqx1OwLme/9e9h2NGgXqEt5rVNSggGa8qpzvsYa5k2UwbeUeXEhedWtsY6SqVaYW7hpF8wXw== X-Received: by 2002:a5d:6845:0:b0:274:357:68ea with SMTP id o5-20020a5d6845000000b00274035768eamr3450721wrw.7.1671881726595; Sat, 24 Dec 2022 03:35:26 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id c8-20020a5d4148000000b002428c4fb16asm5332043wrq.10.2022.12.24.03.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 24 Dec 2022 03:35:26 -0800 (PST) X-Google-Original-From: Iain Sandoe <iain@sandoe.co.uk> To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: Export the __gnu_cxx::zoneinfo_dir_override symbol. Date: Sat, 24 Dec 2022 11:35:25 +0000 Message-Id: <20221224113525.20201-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Iain Sandoe via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe <iains.gcc@gmail.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
libstdc++: Export the __gnu_cxx::zoneinfo_dir_override symbol.
|
|
Commit Message
Iain Sandoe
Dec. 24, 2022, 11:35 a.m. UTC
If this is not the right place to export the symbol (or you do not want
to export it in the general case), I can always add a platform-specific
file for it. So far, tested on x86_64-darwin21, wider testing will
follow over the holidays.
OK for trunk?
Iain
--- 8< ---
This symbol needs to be visible in the library interface for Darwin
to override it with a user-provided one.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libstdc++-v3/ChangeLog:
* config/abi/pre/gnu.ver (GLIBCXX_3.4):
Add __gnu_cxx::zoneinfo_dir_override().
---
libstdc++-v3/config/abi/pre/gnu.ver | 3 +++
1 file changed, 3 insertions(+)
Comments
On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > If this is not the right place to export the symbol (or you do not want > to export it in the general case), I can always add a platform-specific > file for it. So far, tested on x86_64-darwin21, wider testing will > follow over the holidays. > > OK for trunk? > I'd like to check if this causes the undefined weak symbol to be exported on ELF, but I suppose that doesn't really cause any harm if it is. The symbol name is in our own namespace so can't clash with user symbols. We can't declare that function in a header, because "zoneinfo_dir_override" is not a reserved name so could clash with user macros (we could prefix it with underscores, but since it's possible to override it without the library providing a declaration, I think it would be "nicer" to not use an ugly reserved name for something users are supposed to define themselves). Iain > > --- 8< --- > > This symbol needs to be visible in the library interface for Darwin > to override it with a user-provided one. > > Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> > > libstdc++-v3/ChangeLog: > > * config/abi/pre/gnu.ver (GLIBCXX_3.4): > Add __gnu_cxx::zoneinfo_dir_override(). > --- > libstdc++-v3/config/abi/pre/gnu.ver | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libstdc++-v3/config/abi/pre/gnu.ver > b/libstdc++-v3/config/abi/pre/gnu.ver > index 570ffca8710..bd4ab450652 100644 > --- a/libstdc++-v3/config/abi/pre/gnu.ver > +++ b/libstdc++-v3/config/abi/pre/gnu.ver > @@ -1104,6 +1104,9 @@ GLIBCXX_3.4 { > # std::uncaught_exception() > _ZSt18uncaught_exceptionv; > > + # __gnu_cxx::zoneinfo_dir_override() > + _ZN9__gnu_cxx21zoneinfo_dir_overrideEv > + > # DO NOT DELETE THIS LINE. Port-specific symbols, if any, will be here. > > local: > -- > 2.37.1 (Apple Git-137.1) > >
> On 24 Dec 2022, at 12:12, Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > > > On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > If this is not the right place to export the symbol (or you do not want > to export it in the general case), I can always add a platform-specific > file for it. So far, tested on x86_64-darwin21, wider testing will > follow over the holidays. > > OK for trunk? > > I'd like to check if this causes the undefined weak symbol to be exported on ELF, I’d expect so, since it’s in the common file. > but I suppose that doesn't really cause any harm if it is. The symbol name is in our own namespace so can't clash with user symbols. We can't declare that function in a header, because "zoneinfo_dir_override" is not a reserved name so could clash with user macros (we could prefix it with underscores, but since it's possible to override it without the library providing a declaration, I think it would be "nicer" to not use an ugly reserved name for something users are supposed to define themselves). I can also investigate the alternate solution for Darwin - where we pass -U,symbolname to the linker. In that case, we do not need to provide a weak def. in the library (it looks more ELF-like) but the symbol does still need to be exported - however that could Darwin-local too as noted above. (none of this is urgent, bootstrap is fixed - I was just poking at the problems while they were fresh in my mind; although the fails are removed when I configure to an installation with tzdata.zi, there are still fails to deal with when using the system installation .. so I’m not ’there’ yet .. ) cheers Iain > > > > > Iain > > --- 8< --- > > This symbol needs to be visible in the library interface for Darwin > to override it with a user-provided one. > > Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> > > libstdc++-v3/ChangeLog: > > * config/abi/pre/gnu.ver (GLIBCXX_3.4): > Add __gnu_cxx::zoneinfo_dir_override(). > --- > libstdc++-v3/config/abi/pre/gnu.ver | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver > index 570ffca8710..bd4ab450652 100644 > --- a/libstdc++-v3/config/abi/pre/gnu.ver > +++ b/libstdc++-v3/config/abi/pre/gnu.ver > @@ -1104,6 +1104,9 @@ GLIBCXX_3.4 { > # std::uncaught_exception() > _ZSt18uncaught_exceptionv; > > + # __gnu_cxx::zoneinfo_dir_override() > + _ZN9__gnu_cxx21zoneinfo_dir_overrideEv > + > # DO NOT DELETE THIS LINE. Port-specific symbols, if any, will be here. > > local: > -- > 2.37.1 (Apple Git-137.1) >
On Sat, 24 Dec 2022 at 12:21, Iain Sandoe <iain@sandoe.co.uk> wrote: > > > > > On 24 Dec 2022, at 12:12, Jonathan Wakely wrote: > > > > > > > > On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > > If this is not the right place to export the symbol (or you do not want > > to export it in the general case), I can always add a platform-specific > > file for it. So far, tested on x86_64-darwin21, wider testing will > > follow over the holidays. > > > > OK for trunk? > > > > I'd like to check if this causes the undefined weak symbol to be exported on ELF, > > I’d expect so, since it’s in the common file. hppa-hp-hpux* wants this symbol to be defined anyway (see PR 108228), so please push your patch to trunk. > > > but I suppose that doesn't really cause any harm if it is. The symbol name is in our own namespace so can't clash with user symbols. We can't declare that function in a header, because "zoneinfo_dir_override" is not a reserved name so could clash with user macros (we could prefix it with underscores, but since it's possible to override it without the library providing a declaration, I think it would be "nicer" to not use an ugly reserved name for something users are supposed to define themselves). > > I can also investigate the alternate solution for Darwin - where we pass -U,symbolname to the linker. > In that case, we do not need to provide a weak def. in the library (it looks more ELF-like) but the symbol > does still need to be exported - however that could Darwin-local too as noted above. > > (none of this is urgent, bootstrap is fixed - I was just poking at the problems while they were fresh in > my mind; although the fails are removed when I configure to an installation with tzdata.zi, there are > still fails to deal with when using the system installation .. so I’m not ’there’ yet .. ) > > cheers > Iain > > > > > > > > > > > Iain > > > > --- 8< --- > > > > This symbol needs to be visible in the library interface for Darwin > > to override it with a user-provided one. > > > > Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> > > > > libstdc++-v3/ChangeLog: > > > > * config/abi/pre/gnu.ver (GLIBCXX_3.4): > > Add __gnu_cxx::zoneinfo_dir_override(). > > --- > > libstdc++-v3/config/abi/pre/gnu.ver | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver > > index 570ffca8710..bd4ab450652 100644 > > --- a/libstdc++-v3/config/abi/pre/gnu.ver > > +++ b/libstdc++-v3/config/abi/pre/gnu.ver > > @@ -1104,6 +1104,9 @@ GLIBCXX_3.4 { > > # std::uncaught_exception() > > _ZSt18uncaught_exceptionv; > > > > + # __gnu_cxx::zoneinfo_dir_override() > > + _ZN9__gnu_cxx21zoneinfo_dir_overrideEv > > + > > # DO NOT DELETE THIS LINE. Port-specific symbols, if any, will be here. > > > > local: > > -- > > 2.37.1 (Apple Git-137.1) > > >
On Wed, Jan 04, 2023 at 03:17:42PM +0000, Jonathan Wakely via Gcc-patches wrote: > On Sat, 24 Dec 2022 at 12:21, Iain Sandoe <iain@sandoe.co.uk> wrote: > > > > > > > > > On 24 Dec 2022, at 12:12, Jonathan Wakely wrote: > > > > > > > > > > > > On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > > > If this is not the right place to export the symbol (or you do not want > > > to export it in the general case), I can always add a platform-specific > > > file for it. So far, tested on x86_64-darwin21, wider testing will > > > follow over the holidays. > > > > > > OK for trunk? > > > > > > I'd like to check if this causes the undefined weak symbol to be exported on ELF, > > > > I’d expect so, since it’s in the common file. > > hppa-hp-hpux* wants this symbol to be defined anyway (see PR 108228), > so please push your patch to trunk. Isn't it wrong though to export it with GLIBCXX_3.4 symbol version? I mean, if it wasn't exported in GCC 3.4 libstdc++.so, then it shouldn't be in that symver. Perhaps GLIBCXX_3.4.31 instead? Jakub
On Wed, 4 Jan 2023 at 17:14, Jakub Jelinek wrote: > > On Wed, Jan 04, 2023 at 03:17:42PM +0000, Jonathan Wakely via Gcc-patches wrote: > > On Sat, 24 Dec 2022 at 12:21, Iain Sandoe <iain@sandoe.co.uk> wrote: > > > > > > > > > > > > > On 24 Dec 2022, at 12:12, Jonathan Wakely wrote: > > > > > > > > > > > > > > > > On Sat, 24 Dec 2022, 11:35 Iain Sandoe via Libstdc++, <libstdc++@gcc.gnu.org> wrote: > > > > If this is not the right place to export the symbol (or you do not want > > > > to export it in the general case), I can always add a platform-specific > > > > file for it. So far, tested on x86_64-darwin21, wider testing will > > > > follow over the holidays. > > > > > > > > OK for trunk? > > > > > > > > I'd like to check if this causes the undefined weak symbol to be exported on ELF, > > > > > > I’d expect so, since it’s in the common file. > > > > hppa-hp-hpux* wants this symbol to be defined anyway (see PR 108228), > > so please push your patch to trunk. > > Isn't it wrong though to export it with GLIBCXX_3.4 symbol version? > I mean, if it wasn't exported in GCC 3.4 libstdc++.so, then it shouldn't > be in that symver. Perhaps GLIBCXX_3.4.31 instead? Oops, yes! I didn't notice that! I'll move it. Thanks for catching that.
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index 570ffca8710..bd4ab450652 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -1104,6 +1104,9 @@ GLIBCXX_3.4 { # std::uncaught_exception() _ZSt18uncaught_exceptionv; + # __gnu_cxx::zoneinfo_dir_override() + _ZN9__gnu_cxx21zoneinfo_dir_overrideEv + # DO NOT DELETE THIS LINE. Port-specific symbols, if any, will be here. local: