I think I made an mistake splitting the pattern:
- _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][0-9][a-z]*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE11_[MS]_*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE1[2-8][a-z]*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE[2-9][0-9][a-z]*;
Note that for 11 I am now matching _M_disjunt. Looking at
the baseline_symbols.txt file,
this seem to be only name with 11 characters, so the pattern seem
unnecessary.
Could you check if the following patch fixes it for you?
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver
b/libstdc++-v3/config/abi/pre/gnu.ver
index 2ff2aa02383..433b36af965 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -270,7 +270,6 @@ GLIBCXX_3.4 {
_ZNKSs[5-9][a-b]*;
_ZNKSs[0-8][d-e]*;
_ZNKSs[0-9][g-z]*;
- _ZNKSs11_[MS]_*;
_ZNKSs1[2-8][a-z]*;
_ZNKSs[2-9][0-9][a-z]*;
_ZNKSs4find*;
@@ -343,7 +342,6 @@ GLIBCXX_3.4 {
_ZNKSbIwSt11char_traitsIwESaIwEE[5-9][a-b]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[0-8][d-e]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[0-9][g-z]*;
- _ZNKSbIwSt11char_traitsIwESaIwEE11_[MS]_*;
_ZNKSbIwSt11char_traitsIwESaIwEE1[2-8][a-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[2-9][0-9][a-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[abd-z]*;
@@ -1815,7 +1813,6 @@ GLIBCXX_3.4.21 {
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]Ev;
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]I[PN]*;
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE[Daip]*;
-
_ZNKSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE11_[MS]_*;
_ZNKSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE1[2-9]*;
_ZNKSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE[2-8]*;
_ZNKSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEixE[jmy];
On Wed, Apr 8, 2026 at 7:41 PM Rainer Orth <[email protected]>
wrote:
> Hi Jonathan,
>
> > On Sat, 4 Apr 2026, 17:26 Tomasz Kamiński, <[email protected]> wrote:
> >
> >> The C++20 standard added new starts_with and ends_with members to
> >> std::basic_string, which were not previously instantiated in the
> library.
> >> This meant that the extern template declarations had to be disabled for
> >> C++20 mode. With this patch the new members are instantiated in the
> >> library and so the explicit instantiation declarations can be used for
> >> C++20.
> >>
> >> Furthermore, basic_string default constructor is now constrained with
> >> is_default_constructible_v<_Alloc> constrains, that is included in
> >> mangled name, so we also need to instantiate and export it.
> >>
> >> The new members added by C++23 are still not exported, and so the
> >> explicit instantiation declarations are still disabled for C++23.
> >>
> >> libstdc++-v3/ChangeLog:
> >>
> >> * config/abi/pre/gnu.ver (GLIBCXX_3.4): Make string exports
> >> less greedy.
> >> (GLIBCXX_3.4.26): Export basic_string default constructor and
> >> starts_with and ends_with members.
> >> * include/bits/basic_string.h: Update __cpluplus checks for
> C++20.
> >> * include/bits/cow_string.h: Likewise.
> >> * include/bits/basic_string.tcc: Declare explicit instantiations
> >> for C++20 as well as earlier dialects.
> >> * src/c++20/Makefile.am: Add cow-string-inst.cc and
> >> string-inst.cc source files.
> >> * src/c++20/Makefile.in: Regenerate.
> >> * src/c++20/string-inst.cc: New file defining explicit
> >> instantiations for basic_string default constructor and
> >> starts_with,
> >> ends_with methods added in C++20
> >> * src/c++20/cow-string-inst.cc: Version of above for cow-stings.
> >>
> >> Reviewed-by: Jonathan Wakely <[email protected]>
> >> Signed-off-by: Tomasz Kamiński <[email protected]>
> >> ---
> >> v2 updates the years in copyright and standard reference,
> >> as suggested.
> >>
> >> Tested after Jakub's fix for PR124754 on x86_64-linux,
> >> and all test passed. Same for test -O0.
> >> OK for trunk?
> >>
> >
> > OK, thanks
>
> this patch broke Solaris bootstrap:
>
> ld: fatal: libstdc++-symbols.ver-sun: 3753: symbol
> '_ZNKSs11_M_disjunctEPKc': symbol version conflict
> ld: fatal: libstdc++-symbols.ver-sun: 3765: symbol
> '_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw': symbol version conflict
>
> Both symbols now match GLIBCXX_3.4 and GLIBCXX_3.4.5.
>
> Rainer
>
> --
>
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>