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

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