]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix gnu.ver CXXABI_1.3.16 for Solaris [PR118701]
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 5 Feb 2025 08:59:56 +0000 (09:59 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 5 Feb 2025 08:59:56 +0000 (09:59 +0100)
This patch

commit c6977f765838a5ca8d321d916221a7368622bdd9
Author: Andreas Schwab <schwab@suse.de>
Date:   Tue Jan 21 23:50:15 2025 +0100

    libstdc++: correct symbol version of typeinfo for bfloat16_t on RISC-V

broke the libstdc++-abi/abi_check test on Solaris: the log shows

1 incompatible symbols
0
Argument "{CXXABI_1.3.15}" isn't numeric in numeric eq (==) at /vol/gcc/src/hg/master/local/libstdc++-v3/scripts/extract_symvers.pl line 129.
version status: incompatible
type: uncategorized
status: added

The problem has two parts:

* The patch above introduced a new version in libstdc++.so,
  CXXABI_1.3.16, which everywhere but on RISC-V contains no symbols (a
  weak version).  This is the first time this happened in libstdc++.

* Solaris uses scripts/extract_symvers.pl to determine the version info.
  The script currently chokes on the pvs output for weak versions:

  libstdc++.so.6.0.34 - CXXABI_1.3.16 [WEAK]: {CXXABI_1.3.15};

  instead of

  libstdc++.so.6.0.34 - CXXABI_1.3.16: {CXXABI_1.3.15};

While this patch hardens the script to cope with weak versions, there's
no reason to introduce them in the first place.  So the new version is
only created on __riscv.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2025-01-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
    Jonathan Wakely  <jwakely@redhat.com>

libstdc++-v3:
PR libstdc++/118701
* config/abi/pre/gnu.ver (CXXABI_1.3.16): Move __riscv guard
around version.
* scripts/extract_symvers.pl: Allow for weak versions.
* testsuite/util/testsuite_abi.cc (check_version): Wrap
CXXABI_1.3.16 in __riscv.

libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/scripts/extract_symvers.pl
libstdc++-v3/testsuite/util/testsuite_abi.cc

index 84ce874fe03663eba1648ab59b10306333339766..adadc62e3533959a6d0d0c439d2e776d227aeb50 100644 (file)
@@ -2874,15 +2874,15 @@ CXXABI_1.3.15 {
 
 } CXXABI_1.3.14;
 
+#ifdef __riscv
 CXXABI_1.3.16 {
 
-#ifdef __riscv
     _ZTIDF16b;
     _ZTIPDF16b;
     _ZTIPKDF16b;
-#endif
 
 } CXXABI_1.3.15;
+#endif
 
 # Symbols in the support library (libsupc++) supporting transactional memory.
 CXXABI_TM_1 {
index e0e6e5b70c4a75b62cc3f03f414305f9b4a2de2a..fb18e11a1b3ef5caa159193c7ea0a2b1caf353c9 100644 (file)
@@ -34,8 +34,18 @@ while (<PVS>) {
     # Remove trailing semicolon.
     s/;$//;
 
-    # shared object, dash, version, symbol, [size]
-    (undef, undef, $version, $symbol, $size) = split;
+    if (/\[WEAK\]/) {
+       # Allow for weak versions like
+       # libstdc++.so.6.0.34 - CXXABI_1.3.16 [WEAK]: {CXXABI_1.3.15};
+       #
+       # shared object, dash, version "[WEAK]", symbol, [size]
+       (undef, undef, $version, undef, $symbol, $size) = split;
+    } else {
+       # libstdc++.so.6.0.34 - CXXABI_1.3.16: {CXXABI_1.3.15};
+       #
+       # shared object, dash, version, symbol, [size]
+       (undef, undef, $version, $symbol, $size) = split;
+    }
 
     # Remove colon separator from version field.
     $version =~ s/:$//;
index 0d6080fb92c0d1541a9d841c675678e6d9159d67..1b4044c9518881bc9f42898b5c6acf60696fd84c 100644 (file)
@@ -237,7 +237,9 @@ check_version(symbol& test, bool added)
       known_versions.push_back("CXXABI_1.3.13");
       known_versions.push_back("CXXABI_1.3.14");
       known_versions.push_back("CXXABI_1.3.15");
+#ifdef __riscv
       known_versions.push_back("CXXABI_1.3.16");
+#endif
       known_versions.push_back("CXXABI_IEEE128_1.3.13");
       known_versions.push_back("CXXABI_TM_1");
       known_versions.push_back("CXXABI_FLOAT128");