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

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