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

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