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

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