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

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