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

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