libstdc++: Fix duplicated export on basic_string::_M_disjunct on Solaris.

Message ID 20260408205924.31756-1-tkaminsk@redhat.com
State Committed
Commit 7762443b9e6f82b4b6fd7aa8b5c1e83e7e5b4066
Headers
Series libstdc++: Fix duplicated export on basic_string::_M_disjunct on Solaris. |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed

Commit Message

Tomasz Kaminski April 8, 2026, 8:56 p.m. UTC
  The patterns for cow_string that were split to exclude starts_with,
ends_with, did not include name starting with _:
 _ZNKSs[0-9][0-9][a-z]*;
 _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][0-9][a-z]*;

This was not caught on x86_64-linux as _M_disjunt was already exported
in 3.4 version (when HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
is defined).

libstdc++-v3/ChangeLog:

	* config/abi/pre/gnu.ver (GLIBCXX_3.4): Remove _ZNKSs11_[MS]_*
	and _ZNKSbIwSt11char_traitsIwESaIwEE11_[MS]_* patterns.
---
I got this patterns wrong, because SSO string pattern includes _M_disjunct,
and I have seen this funciton being exported in 3.4 version on linux.

Tested on x86_64-linux (check-abi and baseline). Rainer confirmed it fixes 
Solaris. OK for trunk?

 libstdc++-v3/config/abi/pre/gnu.ver | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Tomasz Kaminski April 10, 2026, 6:22 a.m. UTC | #1
On Thu, Apr 9, 2026 at 2:39 AM Tomasz Kamiński <tkaminsk@redhat.com> wrote:

> The patterns for cow_string that were split to exclude starts_with,
> ends_with, did not include name starting with _:
>  _ZNKSs[0-9][0-9][a-z]*;
>  _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][0-9][a-z]*;
>
> This was not caught on x86_64-linux as _M_disjunt was already exported
> in 3.4 version (when HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
> is defined).
>
> libstdc++-v3/ChangeLog:
>
>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Remove _ZNKSs11_[MS]_*
>         and _ZNKSbIwSt11char_traitsIwESaIwEE11_[MS]_* patterns.
> ---
> I got this patterns wrong, because SSO string pattern includes _M_disjunct,
> and I have seen this funciton being exported in 3.4 version on linux.
>
For reference it was exported in 3.4 here:
#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
   # GLIBCXX_ABI compatibility only.
    # std::string
    _ZNKSs11_M_disjunctEPKc;
    _ZNKSs15_M_check_lengthE[jmy][jmy]PKc;



>
> Tested on x86_64-linux (check-abi and baseline). Rainer confirmed it fixes
> Solaris. OK for trunk?
>
>  libstdc++-v3/config/abi/pre/gnu.ver | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/libstdc++-v3/config/abi/pre/gnu.ver
> b/libstdc++-v3/config/abi/pre/gnu.ver
> index 2ff2aa02383..624de951d41 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]*;
> --
> 2.53.0
>
>
  
Jonathan Wakely April 13, 2026, 10:43 a.m. UTC | #2
On Thu, 9 Apr 2026 at 01:39, Tomasz Kamiński <tkaminsk@redhat.com> wrote:
>
> The patterns for cow_string that were split to exclude starts_with,
> ends_with, did not include name starting with _:
>  _ZNKSs[0-9][0-9][a-z]*;
>  _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][0-9][a-z]*;
>
> This was not caught on x86_64-linux as _M_disjunt was already exported
> in 3.4 version (when HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
> is defined).
>
> libstdc++-v3/ChangeLog:
>
>         * config/abi/pre/gnu.ver (GLIBCXX_3.4): Remove _ZNKSs11_[MS]_*
>         and _ZNKSbIwSt11char_traitsIwESaIwEE11_[MS]_* patterns.
> ---
> I got this patterns wrong, because SSO string pattern includes _M_disjunct,
> and I have seen this funciton being exported in 3.4 version on linux.
>
> Tested on x86_64-linux (check-abi and baseline). Rainer confirmed it fixes
> Solaris. OK for trunk?
>

OK

>  libstdc++-v3/config/abi/pre/gnu.ver | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
> index 2ff2aa02383..624de951d41 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]*;
> --
> 2.53.0
>
  

Patch

diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 2ff2aa02383..624de951d41 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]*;