Blame SOURCES/0013-Rename-__CXXSTDLIB_SO_VERSION__-to-__LIBSTDCXX_SO_VE.patch

0fe1ac
From c922a56d4461c9e4ca2af07ecccb3626b99a35ae Mon Sep 17 00:00:00 2001
0fe1ac
From: David Malcolm <dmalcolm@redhat.com>
0fe1ac
Date: Thu, 2 Sep 2021 11:44:37 -0400
0fe1ac
Subject: [PATCH 13/17] Rename __CXXSTDLIB_SO_VERSION__ to
0fe1ac
 __LIBSTDCXX_SO_VERSION and only use major version
0fe1ac
0fe1ac
---
0fe1ac
 .../testsuite/22_locale/messages/13631.cc      |  4 ++--
0fe1ac
 libstdc++-v3/testsuite/lib/dts.exp             | 18 +++++-------------
0fe1ac
 libstdc++-v3/testsuite/lib/libstdc++.exp       |  4 ++--
0fe1ac
 3 files changed, 9 insertions(+), 17 deletions(-)
0fe1ac
0fe1ac
diff --git a/libstdc++-v3/testsuite/22_locale/messages/13631.cc b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
0fe1ac
index 5b20df382..f4c5eb7a2 100644
0fe1ac
--- a/libstdc++-v3/testsuite/22_locale/messages/13631.cc
0fe1ac
+++ b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
0fe1ac
@@ -51,7 +51,7 @@ void test01()
0fe1ac
   msgs_facet.close(msgs);
0fe1ac
 
0fe1ac
   // Fixed upstream in GCC 5
0fe1ac
-#if __CXXSTDLIB_SO_VERSION__ >= 501000
0fe1ac
+#if __LIBSTDCXX_SO_VERSION >= 5
0fe1ac
   VERIFY( translation1 == translation2 );
0fe1ac
 #endif
0fe1ac
 }
0fe1ac
@@ -77,7 +77,7 @@ void test02()
0fe1ac
   // Without a real translation this test doesn't mean anything:
0fe1ac
 
0fe1ac
   // Fixed upstream in GCC 5
0fe1ac
-#if __CXXSTDLIB_SO_VERSION__ >= 501000
0fe1ac
+#if __LIBSTDCXX_SO_VERSION >= 5
0fe1ac
   VERIFY( !translation1.empty() );
0fe1ac
   VERIFY( translation1 != msgid );
0fe1ac
 #endif
0fe1ac
diff --git a/libstdc++-v3/testsuite/lib/dts.exp b/libstdc++-v3/testsuite/lib/dts.exp
0fe1ac
index dc5cf3e95..60f94bd6d 100644
0fe1ac
--- a/libstdc++-v3/testsuite/lib/dts.exp
0fe1ac
+++ b/libstdc++-v3/testsuite/lib/dts.exp
0fe1ac
@@ -1,15 +1,10 @@
0fe1ac
-# For DTS testing, generate a number expressing the
0fe1ac
-# system version of libstdc++.so
0fe1ac
-#
0fe1ac
-# Generate a version number equivalent to
0fe1ac
-#  #define GCC_VERSION (__GNUC__ * 10000 \
0fe1ac
-#                       + __GNUC_MINOR__ * 100 \
0fe1ac
-#                       + __GNUC_PATCHLEVEL__)
0fe1ac
+# For DTS testing, get the major version of the
0fe1ac
+# system libstdc++.so
0fe1ac
 #
0fe1ac
 # For example, given an underlying version of gcc 4.8.5
0fe1ac
-# this function will return 408050.
0fe1ac
+# this function will return 4
0fe1ac
 
0fe1ac
-proc get_dts_base_version { } {
0fe1ac
+proc get_dts_base_major_version { } {
0fe1ac
 
0fe1ac
     # Invoke /usr/bin/gcc to get at the underlying GCC version
0fe1ac
     # in dotted form (e.g. "4.8.5").
0fe1ac
@@ -24,8 +19,5 @@ proc get_dts_base_version { } {
0fe1ac
     verbose "minor: '$minor'" 2
0fe1ac
     verbose "patchlevel: '$patchlevel'" 2
0fe1ac
 
0fe1ac
-    set base_gcc_version [expr (($major * 10000) + ($minor * 100)  + $patchlevel)]
0fe1ac
-    verbose "base_gcc_version: '$base_gcc_version'" 2
0fe1ac
-
0fe1ac
-    return $base_gcc_version
0fe1ac
+    return $major
0fe1ac
 }
0fe1ac
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
0fe1ac
index 5e4b32f76..297485b19 100644
0fe1ac
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
0fe1ac
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
0fe1ac
@@ -326,8 +326,8 @@ proc libstdc++_init { testfile } {
0fe1ac
 
0fe1ac
     # For DTS testing, expose the system version of libstdc++.so as
0fe1ac
     # a preprocessor define.
0fe1ac
-    set base_gcc_version [get_dts_base_version]
0fe1ac
-    set cxxflags "$cxxflags -D__CXXSTDLIB_SO_VERSION__=$base_gcc_version"
0fe1ac
+    set base_gcc_version [get_dts_base_major_version]
0fe1ac
+    set cxxflags "$cxxflags -D__LIBSTDCXX_SO_VERSION=$base_gcc_version"
0fe1ac
 
0fe1ac
     # If a PCH file is available, use it.  We must delay performing
0fe1ac
     # this check until $cxx and such have been initialized because we
0fe1ac
-- 
0fe1ac
2.31.1
0fe1ac