Re: Fix gnu versioned namespace mode 01/03

2024-05-07 Thread Iain Sandoe
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  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
> 



Fix gnu versioned namespace mode 01/03

2024-05-04 Thread François Dumont

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
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
 ## .
 
-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];
+_ZTVN9__gnu_cxx3__918stdio_sync_filebufI[cw]NSt3__911char_traitsI[cw];
 
 # 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_traitsIwvRNS_13basic_istreamIT_T0_EEPS4_[ilx];
+
_ZNSt3__917__istream_extractIwNS_11char_traitsIwvRNS_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