Re: [committed 1/2] libstdc++: Export basic_stringbuf constructor [PR 97729]

2020-11-06 Thread Jonathan Wakely via Gcc-patches

On 06/11/20 11:56 +0100, Rainer Orth wrote:

Hi Jonathan,


libstdc++-v3/ChangeLog:

PR libstdc++/97729
* config/abi/pre/gnu.ver (GLIBCXX_3.4.29): Add exports.
* src/c++20/sstream-inst.cc (basic_stringbuf): Instantiate
private constructor taking __xfer_bufptrs.

Tested powerpc64le-linux. Committed to trunk.


unfortunately, this broke Solaris bootstrap again:

ld: fatal: libstdc++-symbols.ver-sun: 7314: symbol 
'_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEC1EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict
ld: fatal: libstdc++-symbols.ver-sun: 7315: symbol 
'_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEC2EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict
ld: fatal: libstdc++-symbols.ver-sun: 7316: symbol 
'_ZNSt7__cxx1115basic_stringbufIwSt11char_traitsIwESaIwEEC1EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict
ld: fatal: libstdc++-symbols.ver-sun: 7317: symbol 
'_ZNSt7__cxx1115basic_stringbufIwSt11char_traitsIwESaIwEEC2EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict

Those are matched by both

   
##_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]EOS4_RKS3_ONS4_14__xfer_bufptrsE
 (glob)

but also by the previous

   ##_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]*__xfer_bufptrs* 
(glob)

I do have a hacky patch to avoid this, but I guess I best leave it to
you how to best tighten the previous pattern.


It should be fixed at 887515acd27e49c176395ab76d5826959d89cb9b which
is the attached patch. Only tested on x86_64-linux, but my script no
longer shows the conflicts.

I'll try to incorporate that script into the testsuite for gcc-11, or
rewrite it as aprt of testsuite/util/testsuite_abi.cc


commit 887515acd27e49c176395ab76d5826959d89cb9b
Author: Jonathan Wakely 
Date:   Fri Nov 6 19:53:36 2020

libstdc++: Fix symbol version conflict in linker script

The change in r11-4748-50b840ac5e1d6534e345c3fee9a97ae45ced6bc7 causes
a build error on Solaris, due to the new explicit instantiation matching
patterns for two different symbol versions.

libstdc++-v3/ChangeLog:

* config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Tighten up patterns
for basic_stringbuf that refer to __xfer_bufptrs.

diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index ed68ffa28723..2d0f87aa7cc7 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1774,7 +1774,8 @@ GLIBCXX_3.4.21 {
 _ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]ERKNS_12basic_stringI[cw]S2_S3_EESt13_Ios_Openmode;
 _ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]ESt13_Ios_Openmode;
 _ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EED[012]Ev;
-_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]*__xfer_bufptrs*;
+_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]EOS4_ONS4_14__xfer_bufptrsE;
+_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]14__xfer_bufptrs[CD][12]*;
 _ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[a1346789]*;
 #   _ZNSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]*;
 _ZNSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]EOS4_;


Re: [committed 1/2] libstdc++: Export basic_stringbuf constructor [PR 97729]

2020-11-06 Thread Rainer Orth
Hi Jonathan,

> libstdc++-v3/ChangeLog:
>
>   PR libstdc++/97729
>   * config/abi/pre/gnu.ver (GLIBCXX_3.4.29): Add exports.
>   * src/c++20/sstream-inst.cc (basic_stringbuf): Instantiate
>   private constructor taking __xfer_bufptrs.
>
> Tested powerpc64le-linux. Committed to trunk.

unfortunately, this broke Solaris bootstrap again:

ld: fatal: libstdc++-symbols.ver-sun: 7314: symbol 
'_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEC1EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict
ld: fatal: libstdc++-symbols.ver-sun: 7315: symbol 
'_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEC2EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict
ld: fatal: libstdc++-symbols.ver-sun: 7316: symbol 
'_ZNSt7__cxx1115basic_stringbufIwSt11char_traitsIwESaIwEEC1EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict
ld: fatal: libstdc++-symbols.ver-sun: 7317: symbol 
'_ZNSt7__cxx1115basic_stringbufIwSt11char_traitsIwESaIwEEC2EOS4_RKS3_ONS4_14__xfer_bufptrsE':
 symbol version conflict

Those are matched by both


##_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]EOS4_RKS3_ONS4_14__xfer_bufptrsE
 (glob)

but also by the previous

##_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]*__xfer_bufptrs* 
(glob)

I do have a hacky patch to avoid this, but I guess I best leave it to
you how to best tighten the previous pattern.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[committed 1/2] libstdc++: Export basic_stringbuf constructor [PR 97729]

2020-11-05 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog:

PR libstdc++/97729
* config/abi/pre/gnu.ver (GLIBCXX_3.4.29): Add exports.
* src/c++20/sstream-inst.cc (basic_stringbuf): Instantiate
private constructor taking __xfer_bufptrs.

Tested powerpc64le-linux. Committed to trunk.

commit 50b840ac5e1d6534e345c3fee9a97ae45ced6bc7
Author: Jonathan Wakely 
Date:   Thu Nov 5 13:41:40 2020

libstdc++: Export basic_stringbuf constructor [PR 97729]

libstdc++-v3/ChangeLog:

PR libstdc++/97729
* config/abi/pre/gnu.ver (GLIBCXX_3.4.29): Add exports.
* src/c++20/sstream-inst.cc (basic_stringbuf): Instantiate
private constructor taking __xfer_bufptrs.

diff --git a/libstdc++-v3/config/abi/pre/gnu.ver 
b/libstdc++-v3/config/abi/pre/gnu.ver
index 707539a17c3a..ed68ffa28723 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -2346,6 +2346,7 @@ GLIBCXX_3.4.29 {
 
 # basic_stringbuf::basic_stringbuf(basic_stringbuf&&, allocator const&)
 
_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]EOS4_RKS3_;
+
_ZNSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]EOS4_RKS3_ONS4_14__xfer_bufptrsE;
 
 # basic_stringbuf::get_allocator()
 
_ZNKSt7__cxx1115basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE13get_allocatorEv;
diff --git a/libstdc++-v3/src/c++20/sstream-inst.cc 
b/libstdc++-v3/src/c++20/sstream-inst.cc
index ada3eabac1f5..7d275de5cc24 100644
--- a/libstdc++-v3/src/c++20/sstream-inst.cc
+++ b/libstdc++-v3/src/c++20/sstream-inst.cc
@@ -41,6 +41,9 @@ template 
basic_stringbuf::basic_stringbuf(__string_type&&,
ios_base::openmode);
 template basic_stringbuf::basic_stringbuf(basic_stringbuf&&,
const allocator_type&);
+template basic_stringbuf::basic_stringbuf(basic_stringbuf&&,
+   const allocator_type&,
+   __xfer_bufptrs&&);
 template basic_stringbuf::allocator_type
 basic_stringbuf::get_allocator() const noexcept;
 template string_view
@@ -75,6 +78,9 @@ template 
basic_stringbuf::basic_stringbuf(__string_type&&,
   ios_base::openmode);
 template basic_stringbuf::basic_stringbuf(basic_stringbuf&&,
   const allocator_type&);
+template basic_stringbuf::basic_stringbuf(basic_stringbuf&&,
+  const allocator_type&,
+  __xfer_bufptrs&&);
 template basic_stringbuf::allocator_type
 basic_stringbuf::get_allocator() const noexcept;