diff mbox series

Fix gnu versioned namespace mode 01/03

Message ID b4dac42c-666c-4700-bc39-9a03ec99f327@gmail.com
State New
Headers show
Series Fix gnu versioned namespace mode 01/03 | expand

Commit Message

François Dumont May 4, 2024, 9:11 p.m. UTC
libstdc++: Bump gnu versioned namespace to __9

libstdc++-v3/ChangeLog:

             * acinclude.m4 (libtool_VERSION): Bump to 9:0:0.
             * config/abi/pre/gnu-versioned-namespace.ver (GLIBCXX_8.0): 
Replace by GLIBCXX_9.0.
             Adapt all references to __8 namespace.
             * configure: Regenerate.
             * include/bits/c++config 
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Define as 'namespace __9{'.
             (_GLIBCXX_STD_V): Adapt.
             * include/std/format (to_chars): Update namespace version 
in symbols alias definitions.
             (__format::_Arg_store): Update namespace version in 
make_format_args friend
             declaration.
             * python/libstdcxx/v6/printers.py (_versioned_namespace): 
Assign '__9::'.
             * python/libstdcxx/v6/xmethods.py: Likewise.
             * testsuite/23_containers/map/48101_neg.cc: Adapt dg-error.
             * testsuite/23_containers/multimap/48101_neg.cc: Likewise.
             * testsuite/20_util/function/cons/70692.cc: Likewise.
             * testsuite/20_util/function_objects/bind_back/111327.cc: 
Likewise.
             * testsuite/20_util/function_objects/bind_front/111327.cc: 
Likewise.
             * testsuite/lib/prune.exp (libstdc++-dg-prune): Bump 
version namespace.

Ok to commit ?

François

Comments

Iain Sandoe May 7, 2024, 4:08 p.m. UTC | #1
Hi François

As you know I am keen to see this land - but having had some experience with applying previous patches to actual toolchain builds .. 

> On 4 May 2024, at 22:11, François Dumont <frs.dumont@gmail.com> wrote:
> 
> libstdc++: Bump gnu versioned namespace to __9

I think that the namespace version should be a top-level configure choice.  —with-libstdcxx-namespace-version= (for example) - we ought to be able to make that the only thing that is required to trigger the process.

The reasons are:

 1. (significant) The information is needed by both the (FE) testsuites and the library ( I do not think the it’s a nice maintenance job to have to go through all the testcases that have the namespace visible and change them for each GCC release); instead we should arrange to set some variable in gcc/site.exp that the FE tests can consume (I do not think that this is too hard to arrange - although it might be necessary to figure out how to make scan* tests work with it)

 2. (nice-to-have) For targets which have never used a versioned namespace it seems odd to jump straight from 6 to 9.

Iain

> 
> libstdc++-v3/ChangeLog:
> 
>             * acinclude.m4 (libtool_VERSION): Bump to 9:0:0.
>             * config/abi/pre/gnu-versioned-namespace.ver (GLIBCXX_8.0): Replace by GLIBCXX_9.0.
>             Adapt all references to __8 namespace.
>             * configure: Regenerate.
>             * include/bits/c++config (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Define as 'namespace __9{'.
>             (_GLIBCXX_STD_V): Adapt.
>             * include/std/format (to_chars): Update namespace version in symbols alias definitions.
>             (__format::_Arg_store): Update namespace version in make_format_args friend
>             declaration.
>             * python/libstdcxx/v6/printers.py (_versioned_namespace): Assign '__9::'.
>             * python/libstdcxx/v6/xmethods.py: Likewise.
>             * testsuite/23_containers/map/48101_neg.cc: Adapt dg-error.
>             * testsuite/23_containers/multimap/48101_neg.cc: Likewise.
>             * testsuite/20_util/function/cons/70692.cc: Likewise.
>             * testsuite/20_util/function_objects/bind_back/111327.cc: Likewise.
>             * testsuite/20_util/function_objects/bind_front/111327.cc: Likewise.
>             * testsuite/lib/prune.exp (libstdc++-dg-prune): Bump version namespace.
> 
> Ok to commit ?
> 
> François
> <bump_version_ns_patch.txt>
diff mbox series

Patch

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 51a08bcc8b1..8978355a6d3 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -4243,7 +4243,7 @@  case $enable_symvers in
 	      [Define to use GNU versioning in the shared library.])
     ;;
   gnu-versioned-namespace)
-    libtool_VERSION=8:0:0
+    libtool_VERSION=9:0:0
     SYMVER_FILE=config/abi/pre/gnu-versioned-namespace.ver
     AC_DEFINE(_GLIBCXX_SYMVER_GNU_NAMESPACE, 1,
 	      [Define to use GNU namespace versioning in the shared library.])
diff --git a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
index bdf8f40f1f6..d3d30b5bafa 100644
--- a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
+++ b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
@@ -19,7 +19,7 @@ 
 ## with this library; see the file COPYING3.  If not see
 ## <http://www.gnu.org/licenses/>.
 
-GLIBCXX_8.0 {
+GLIBCXX_9.0 {
 
   global:
 
@@ -27,7 +27,7 @@  GLIBCXX_8.0 {
     extern "C++"
     {
       std::*;
-      std::__8::*;
+      std::__9::*;
     };
 
     # operator new(size_t)
@@ -59,7 +59,7 @@  GLIBCXX_8.0 {
     # vtable
     _ZTVSt*;
     _ZTVNSt*;
-    _ZTVN9__gnu_cxx3__818stdio_sync_filebufI[cw]NSt3__811char_traitsI[cw]EEEE;
+    _ZTVN9__gnu_cxx3__918stdio_sync_filebufI[cw]NSt3__911char_traitsI[cw]EEEE;
 
     # thunk
     _ZTv0_n12_NS*;
@@ -74,7 +74,7 @@  GLIBCXX_8.0 {
     _ZTSNSt*;
 
     # locale
-    _ZNSt3__89has_facetINS_*;
+    _ZNSt3__99has_facetINS_*;
 
     # thread/mutex/condition_variable/future
     __once_proxy;
@@ -84,37 +84,37 @@  GLIBCXX_8.0 {
     __emutls_v._ZSt3__815__once_callable;
 
     # std::__convert_to_v
-    _ZNSt3__814__convert_to_v*;
+    _ZNSt3__914__convert_to_v*;
 
     # std::__copy_streambufs
-    _ZNSt3__817__copy_streambufsI*;
-    _ZNSt3__821__copy_streambufs_eofI*;
+    _ZNSt3__917__copy_streambufsI*;
+    _ZNSt3__921__copy_streambufs_eofI*;
 
     # std::__istream_extract(wistream&, wchar_t*, streamsize)
-    _ZNSt3__817__istream_extractIwNS_11char_traitsIwEEEEvRNS_13basic_istreamIT_T0_EEPS4_[ilx];
+    _ZNSt3__917__istream_extractIwNS_11char_traitsIwEEEEvRNS_13basic_istreamIT_T0_EEPS4_[ilx];
 
     # __gnu_cxx::__atomic_add
     # __gnu_cxx::__exchange_and_add
-    _ZN9__gnu_cxx3__812__atomic_addEPV[il][il];
-    _ZN9__gnu_cxx3__818__exchange_and_addEPV[li][il];
+    _ZN9__gnu_cxx3__912__atomic_addEPV[il][il];
+    _ZN9__gnu_cxx3__918__exchange_and_addEPV[li][il];
 
     # __gnu_cxx::__pool
-    _ZN9__gnu_cxx3__86__poolILb[01]EE13_M_initializeEv;
-    _ZN9__gnu_cxx3__86__poolILb[01]EE16_M_reserve_blockE[jmy][jmy];
-    _ZN9__gnu_cxx3__86__poolILb[01]EE16_M_reclaim_blockEPc[jmy];
-    _ZN9__gnu_cxx3__86__poolILb[01]EE10_M_destroyEv;
-    _ZN9__gnu_cxx3__86__poolILb1EE16_M_get_thread_idEv;
+    _ZN9__gnu_cxx3__96__poolILb[01]EE13_M_initializeEv;
+    _ZN9__gnu_cxx3__96__poolILb[01]EE16_M_reserve_blockE[jmy][jmy];
+    _ZN9__gnu_cxx3__96__poolILb[01]EE16_M_reclaim_blockEPc[jmy];
+    _ZN9__gnu_cxx3__96__poolILb[01]EE10_M_destroyEv;
+    _ZN9__gnu_cxx3__96__poolILb1EE16_M_get_thread_idEv;
 
-    _ZN9__gnu_cxx3__817__pool_alloc_base9_M_refillE[jmy];
-    _ZN9__gnu_cxx3__817__pool_alloc_base16_M_get_free_listE[jmy];
-    _ZN9__gnu_cxx3__817__pool_alloc_base12_M_get_mutexEv;
+    _ZN9__gnu_cxx3__917__pool_alloc_base9_M_refillE[jmy];
+    _ZN9__gnu_cxx3__917__pool_alloc_base16_M_get_free_listE[jmy];
+    _ZN9__gnu_cxx3__917__pool_alloc_base12_M_get_mutexEv;
 
-    _ZN9__gnu_cxx3__89free_list6_M_getE[jmy];
-    _ZN9__gnu_cxx3__89free_list8_M_clearEv;
+    _ZN9__gnu_cxx3__99free_list6_M_getE[jmy];
+    _ZN9__gnu_cxx3__99free_list8_M_clearEv;
 
     # __gnu_cxx::stdio_sync_filebuf
-    _ZTVN9__gnu_cxx3__818stdio_sync_filebufI[cw]St3__811char_traitsI[cw]EEE;
-    _ZN9__gnu_cxx3__818stdio_sync_filebufI[cw]NSt3__811char_traitsI[cw]EEE[5-9]*;
+    _ZTVN9__gnu_cxx3__918stdio_sync_filebufI[cw]St3__911char_traitsI[cw]EEE;
+    _ZN9__gnu_cxx3__918stdio_sync_filebufI[cw]NSt3__911char_traitsI[cw]EEE[5-9]*;
 
     # debug mode
     _ZN11__gnu_debug19_Safe_sequence_base12_M_get_mutexEv;
@@ -147,10 +147,10 @@  GLIBCXX_8.0 {
     _ZN14__gnu_parallel9_Settings3setERS0_;
 
     # to_chars/from_chars _Float128
-    _ZNSt3__88to_charsEPcS0_DF128_;
-    _ZNSt3__88to_charsEPcS0_DF128_NS_12chars_formatE;
-    _ZNSt3__88to_charsEPcS0_DF128_NS_12chars_formatEi;
-    _ZNSt3__810from_charsEPKcS1_RDF128_NS_12chars_formatE;
+    _ZNSt3__98to_charsEPcS0_DF128_;
+    _ZNSt3__98to_charsEPcS0_DF128_NS_12chars_formatE;
+    _ZNSt3__98to_charsEPcS0_DF128_NS_12chars_formatEi;
+    _ZNSt3__910from_charsEPKcS1_RDF128_NS_12chars_formatE;
 
   local:
     *;
@@ -247,7 +247,7 @@  CXXABI_2.0 {
     _ZSt15_Fnv_hash_bytesPKv*;
 
     # __gnu_cxx::_verbose_terminate_handler()
-    _ZN9__gnu_cxx3__827__verbose_terminate_handlerEv;
+    _ZN9__gnu_cxx3__927__verbose_terminate_handlerEv;
 
     # *_type_info classes, ctor and dtor
     _ZN10__cxxabiv117__array_type_info*;
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 21abaeb0778..343853e4b1e 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -51047,7 +51047,7 @@  $as_echo "#define _GLIBCXX_SYMVER_GNU 1" >>confdefs.h
 
     ;;
   gnu-versioned-namespace)
-    libtool_VERSION=8:0:0
+    libtool_VERSION=9:0:0
     SYMVER_FILE=config/abi/pre/gnu-versioned-namespace.ver
 
 $as_echo "#define _GLIBCXX_SYMVER_GNU_NAMESPACE 1" >>confdefs.h
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index b57e3f338e9..16ef2429367 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -362,7 +362,7 @@  namespace __gnu_cxx
 
 #if _GLIBCXX_INLINE_VERSION
 // Inline namespace for symbol versioning of (nearly) everything in std.
-# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __8 {
+# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __9 {
 # define _GLIBCXX_END_NAMESPACE_VERSION }
 // Unused when everything in std is versioned anyway.
 # define _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(X)
diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index 48deba2bcb2..1ba71e7a3b9 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -1367,7 +1367,7 @@  namespace __format
   to_chars_result
   to_chars(char*, char*, _Float128) noexcept
 #  if _GLIBCXX_INLINE_VERSION
-    __asm("_ZNSt3__88to_charsEPcS0_DF128_");
+    __asm("_ZNSt3__98to_charsEPcS0_DF128_");
 #  else
     __asm("_ZSt8to_charsPcS_DF128_");
 #  endif
@@ -1375,7 +1375,7 @@  namespace __format
   to_chars_result
   to_chars(char*, char*, _Float128, chars_format) noexcept
 #  if _GLIBCXX_INLINE_VERSION
-    __asm("_ZNSt3__88to_charsEPcS0_DF128_NS_12chars_formatE");
+    __asm("_ZNSt3__98to_charsEPcS0_DF128_NS_12chars_formatE");
 #  else
     __asm("_ZSt8to_charsPcS_DF128_St12chars_format");
 #  endif
@@ -1383,7 +1383,7 @@  namespace __format
   to_chars_result
   to_chars(char*, char*, _Float128, chars_format, int) noexcept
 #  if _GLIBCXX_INLINE_VERSION
-    __asm("_ZNSt3__88to_charsEPcS0_DF128_NS_12chars_formatEi");
+    __asm("_ZNSt3__98to_charsEPcS0_DF128_NS_12chars_formatEi");
 #  else
     __asm("_ZSt8to_charsPcS_DF128_St12chars_formati");
 #  endif
@@ -3707,7 +3707,7 @@  namespace __format
       template<typename _Ctx, typename... _Argz>
 	friend auto std::
 #if _GLIBCXX_INLINE_VERSION
-	__8:: // Needed for PR c++/59256
+	__9:: // Needed for PR c++/59256
 #endif
 	make_format_args(_Argz&...) noexcept;
 
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index a6c2ed4599f..037228a02de 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -126,7 +126,7 @@  def find_type(orig, name):
             raise ValueError("Cannot find type %s::%s" % (str(orig), name))
 
 
-_versioned_namespace = '__8::'
+_versioned_namespace = '__9::'
 
 
 def lookup_templ_spec(templ, *args):
diff --git a/libstdc++-v3/python/libstdcxx/v6/xmethods.py b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
index 436c866e001..617b9a16e3f 100644
--- a/libstdc++-v3/python/libstdcxx/v6/xmethods.py
+++ b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
@@ -28,7 +28,7 @@  def get_bool_type():
 def get_std_size_type():
     return gdb.lookup_type('std::size_t')
 
-_versioned_namespace = '__8::'
+_versioned_namespace = '__9::'
 
 def is_specialization_of(x, template_name):
     """
diff --git a/libstdc++-v3/testsuite/20_util/function/cons/70692.cc b/libstdc++-v3/testsuite/20_util/function/cons/70692.cc
index b15208a2531..26324d3f078 100644
--- a/libstdc++-v3/testsuite/20_util/function/cons/70692.cc
+++ b/libstdc++-v3/testsuite/20_util/function/cons/70692.cc
@@ -11,4 +11,4 @@  int main()
   std::function<const int&()> ff(f);  // { dg-error "no matching function" }
   std::function<long&&()> f2(f);      // { dg-error "no matching function" }
 }
-// { dg-error "std::(__8::)?enable_if" "" { target *-*-* } 0 }
+// { dg-error "std::(__9::)?enable_if" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc b/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc
index d634db9dc1d..2ef70134db1 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc
@@ -39,4 +39,4 @@  int main() {
   std::move(std::as_const(g1))();
 }
 
-// { dg-error "no type named 'type' in 'struct std::invoke_result" "" { target c++23 } 0 }
+// { dg-error "no type named 'type' in 'struct std::(__9::)?invoke_result" "" { target c++23 } 0 }
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc b/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc
index 5fe0a83baec..d9bb5a39560 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc
@@ -39,4 +39,4 @@  int main() {
   std::move(std::as_const(g1))();
 }
 
-// { dg-error "no type named 'type' in 'struct std::invoke_result" "" { target c++23 } 0 }
+// { dg-error "no type named 'type' in 'struct std::(__9::)?invoke_result" "" { target c++23 } 0 }
diff --git a/libstdc++-v3/testsuite/23_containers/map/48101_neg.cc b/libstdc++-v3/testsuite/23_containers/map/48101_neg.cc
index 71deaef2881..fa964355c21 100644
--- a/libstdc++-v3/testsuite/23_containers/map/48101_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/48101_neg.cc
@@ -28,8 +28,8 @@  test01()
   c2.find(2); // { dg-error "here" }
 }
 
-// { dg-error "_Compare = std::(__8::)?less<int.>" "" { target *-*-* } 0 }
-// { dg-error "_Compare = std::(__8::)?allocator<int>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::(__9::)?less<int.>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::(__9::)?allocator<int>" "" { target *-*-* } 0 }
 // { dg-error "comparison object must be invocable" "" { target *-*-* } 0 }
 // { dg-prune-output "no match for call" }
 // { dg-prune-output "invalid conversion" }
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/48101_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/48101_neg.cc
index 5b40fe3e021..360d1f28585 100644
--- a/libstdc++-v3/testsuite/23_containers/multimap/48101_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/multimap/48101_neg.cc
@@ -28,8 +28,8 @@  test01()
   c2.find(2); // { dg-error "here" }
 }
 
-// { dg-error "_Compare = std::(__8::)?less<int.>" "" { target *-*-* } 0 }
-// { dg-error "_Compare = std::(__8::)?allocator<int>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::(__9::)?less<int.>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::(__9::)?allocator<int>" "" { target *-*-* } 0 }
 // { dg-error "comparison object must be invocable" "" { target *-*-* } 0 }
 // { dg-prune-output "no match for call" }
 // { dg-prune-output "invalid conversion" }
diff --git a/libstdc++-v3/testsuite/lib/prune.exp b/libstdc++-v3/testsuite/lib/prune.exp
index 071dcf34c1e..2219744d357 100644
--- a/libstdc++-v3/testsuite/lib/prune.exp
+++ b/libstdc++-v3/testsuite/lib/prune.exp
@@ -37,7 +37,7 @@  proc libstdc++-dg-prune { system text } {
       return "::unsupported::hosted C++ headers not supported"
     }
 
-    regsub -all "std::__8::" $text "std::" text
+    regsub -all "std::__9::" $text "std::" text
 
     # Ignore caret diagnostics. Unfortunately dejaGNU trims leading
     # spaces, so one cannot rely on them being present.