public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [committed] libstdc++: Export global iostreams with GLIBCXX_3.4.31 symver [PR108969]
Date: Tue, 18 Apr 2023 17:32:35 +0100	[thread overview]
Message-ID: <CACb0b4=_Z7hBSeNYp4WNq5Bg19BQc9us98KGzyPNqTC+OqNdNA@mail.gmail.com> (raw)
In-Reply-To: <CACb0b4mSdUkAUVADnAjojdrx=RZ94xUPzkfimrt6V=bbPffHcQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

On Tue, 18 Apr 2023 at 17:13, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Tue, 18 Apr 2023 at 16:59, Jonathan Wakely via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
> > diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
> > index 4ae63094eb7..7c015524b62 100644
> > --- a/libstdc++-v3/config/abi/pre/gnu.ver
> > +++ b/libstdc++-v3/config/abi/pre/gnu.ver
> > @@ -2512,6 +2512,20 @@ GLIBCXX_3.4.31 {
> >      _ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv;
> >      _ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv;
> >
> > +#if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \
> > +    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
> > +    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
>
> I've just noticed that these will never be defined, because this
> linker script is preprocessed with config.h not c++config.h, and so it
> should be:
>
> #if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \
>     && defined(HAVE_AS_SYMVER_DIRECTIVE) \
>     && defined(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
>
>
> The condition will never be true as currently written (which doesn't
> actually seem to matter, but Jakub says that re-exporting the symbols
> as the new version is needed in the linker script for older linkers).

Fixed with this patch, pushed to trunk and gcc-13 (after Jakub's approval).

Tested x86_64-linux and sparc-solaris2.11

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1618 bytes --]

commit 6067ae4557a3a7e5b08359e78a29b8a9d5dfedce
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Apr 18 17:22:40 2023

    libstdc++: Fix preprocessor condition in linker script [PR108969]
    
    The linker script is preprocessed with $(top_builddir)/config.h not the
    include/$target/bits/c++config.h version, which means that configure
    macros do not have the _GLIBCXX_ prefix yet.
    
    The _GLIBCXX_SYMVER_GNU and _GLIBCXX_SHARED checks are redundant,
    because the gnu.ver file is only used for _GLIBCXX_SYMVER_GNU and the
    linker script is only used for the shared library. Remove those.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/108969
            * config/abi/pre/gnu.ver: Fix preprocessor condition.

diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 7c015524b62..311a5056e72 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -2512,9 +2512,8 @@ GLIBCXX_3.4.31 {
     _ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv;
     _ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv;
 
-#if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \
-    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
-    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
+#if defined(HAVE_AS_SYMVER_DIRECTIVE) \
+    && defined(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
     # See src/c++98/globals_io.cc
     _ZSt3cin;
     _ZSt4cout;

      reply	other threads:[~2023-04-18 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 15:59 Jonathan Wakely
2023-04-18 16:13 ` Jonathan Wakely
2023-04-18 16:32   ` 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='CACb0b4=_Z7hBSeNYp4WNq5Bg19BQc9us98KGzyPNqTC+OqNdNA@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).