[gcc r12-7679] libstdc++: Fix symbol versioning for Solaris 11.3 [PR103407]

Jonathan Wakely redi@gcc.gnu.org
Wed Mar 16 21:17:47 GMT 2022


https://gcc.gnu.org/g:2f26b26721d5f8a6ac874fc23e18e1b03d207990

commit r12-7679-g2f26b26721d5f8a6ac874fc23e18e1b03d207990
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Mar 16 20:35:47 2022 +0000

    libstdc++: Fix symbol versioning for Solaris 11.3 [PR103407]
    
    The new std::from_chars implementation means that those symbols are now
    defined on Solaris 11.3, which lacks uselocale. They were not present in
    gcc-11, but the linker script gives them the GLIBCXX_3.4.29 symbol
    version because that is the version where they appeared for systems with
    uselocale.
    
    This makes the version for those symbols depend on whether uselocale is
    available or not, so that they get version GLIBCXX_3.4.30 on targets
    where they weren't defined in gcc-11.
    
    In order to avoid needing separate ABI baseline files for Solaris 11.3
    and 11.4, the ABI checker program now treats the floating-point
    std::from_chars overloads as undesignated if they are not found in the
    baseline symbols file. This means they can be left out of the SOlaris
    baseline without causing the check-abi target to fail.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/103407
            * config/abi/pre/gnu.ver: Make version for std::from_chars
            depend on HAVE_USELOCALE macro.
            * testsuite/util/testsuite_abi.cc (compare_symbols): Treat
            std::from_chars for floating-point types as undesignated if
            not found in the baseline symbols file.

Diff:
---
 libstdc++-v3/config/abi/pre/gnu.ver          |  7 +++++++
 libstdc++-v3/testsuite/util/testsuite_abi.cc | 13 +++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index dedee8c1b0a..9b80a31768b 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -2337,8 +2337,10 @@ GLIBCXX_3.4.28 {
 
 GLIBCXX_3.4.29 {
 
+#ifdef HAVE_USELOCALE
     # std::from_chars
     _ZSt10from_charsPKcS0_R[def]St12chars_format;
+#endif
 
     # std::__istream_extract(istream&, char*, streamsize)
     _ZSt17__istream_extractRSiPc[ilx];
@@ -2416,6 +2418,11 @@ GLIBCXX_3.4.29 {
 
 GLIBCXX_3.4.30 {
 
+#ifndef HAVE_USELOCALE
+    # std::from_chars
+    _ZSt10from_charsPKcS0_R[def]St12chars_format;
+#endif
+
     _ZSt21__glibcxx_assert_fail*;
 
 #ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc
index 3dee737b2e5..5c8383554e5 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc
@@ -499,6 +499,19 @@ compare_symbols(const char* baseline_file, const char* test_file,
 	  else
 	    undesignated.push_back(stest);
 	}
+      // See PR libstdc++/103407 -  abi_check FAILs on Solaris
+      else if (stest.type == symbol::function
+		 && stest.name.compare(0, 23, "_ZSt10from_charsPKcS0_R") == 0
+		 && stest.name.find_first_of("def", 23) == 23
+		 && (stest.version_name == "GLIBCXX_3.4.29"
+		       || stest.version_name == "GLIBCXX_3.4.30"))
+	{
+	  stest.status = symbol::undesignated;
+	  if (!check_version(stest, false))
+	    incompatible.push_back(symbol_pair(stest, stest));
+	  else
+	    undesignated.push_back(stest);
+	}
       else
 	{
 	  stest.status = symbol::added;


More information about the Libstdc++-cvs mailing list