On 14/06/17 19:13 +0100, Jonathan Wakely wrote:
There are two symbols defined in GCC 7.1's libstdc++.6.0.23 library
which are not exported on all targets (because I wrote "m" in the
linker script instead of "[jmy]").
This patch bumps the library version on gcc-7-branch to 6.0.24 and
exports the "[jy]" versions of the symbols with version the new
GLIBCXX_3.4.24 symbol version.

This requires bumping the version on trunk to 6.0.25 and moving the
new random_device::_M_get_entropy() symbol to GLIBCXX_3.4.25 (which
will be done by the patch in the following mail).
Here's the patch for trunk.

Target maintainers will need to regenerate the baseline symbols on
gcc-7-branch and trunk.

I intend to commit this tomorrow to trunk.



commit 9354adee0dccc3ebc2aff07c3bdac3eb8ccdbda8
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Jun 14 14:06:40 2017 +0100

    PR libstdc++/81092 add std::wstring symbols and bump library version
    
        PR libstdc++/81092
        * acinclude.m4: Bump libtool_VERSION.
        * config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
        * config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
        * config/abi/pre/gnu.ver: Add wstring constructor symbols to
        GLIBCXX_3.4.24 version and move random_device::_M_get_entropy() symbol
        to new GLIBCXX_3.4.25 version.
        * doc/xml/manual/abi.xml: Document new versions.
        * doc/html/*: Regenerate.
        * testsuite/21_strings/basic_string/cons/char/8.cc: Use base object
        constructors to ensure required symbols are exported.
        * testsuite/21_strings/basic_string/cons/wchar_t/8.cc: Likewise.
        * testsuite/util/testsuite_abi.cc: Add new version.

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index baeea67..599308f 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3750,7 +3750,7 @@ changequote([,])dnl
 fi
 
 # For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:24:0
+libtool_VERSION=6:25:0
 
 # Everything parsed; figure out what files and settings to use.
 case $enable_symvers in
diff --git a/libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt 
b/libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt
index f9eab290..e673f4f 100644
--- a/libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/i386-linux-gnu/baseline_symbols.txt
@@ -444,6 +444,7 @@ 
FUNC:_ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4
 FUNC:_ZNKSt13basic_istreamIwSt11char_traitsIwEE6gcountEv@@GLIBCXX_3.4
 FUNC:_ZNKSt13basic_istreamIwSt11char_traitsIwEE6sentrycvbEv@@GLIBCXX_3.4
 FUNC:_ZNKSt13basic_ostreamIwSt11char_traitsIwEE6sentrycvbEv@@GLIBCXX_3.4
+FUNC:_ZNKSt13random_device13_M_getentropyEv@@GLIBCXX_3.4.25
 FUNC:_ZNKSt13runtime_error4whatEv@@GLIBCXX_3.4
 FUNC:_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE5rdbufEv@@GLIBCXX_3.4
 FUNC:_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv@@GLIBCXX_3.4.5
@@ -1329,6 +1330,7 @@ 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1EPKwRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1EPKwjRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_@@GLIBCXX_3.4
+FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_jRKS1_@@GLIBCXX_3.4.24
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_jj@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_jjRKS1_@@GLIBCXX_3.4
 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ESt16initializer_listIwERKS1_@@GLIBCXX_3.4.11
@@ -1342,6 +1344,7 @@ 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2EPKwRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2EPKwjRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_@@GLIBCXX_3.4
+FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_jRKS1_@@GLIBCXX_3.4.24
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_jj@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_jjRKS1_@@GLIBCXX_3.4
 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ESt16initializer_listIwERKS1_@@GLIBCXX_3.4.11
@@ -4002,6 +4005,8 @@ OBJECT:0:GLIBCXX_3.4.20
 OBJECT:0:GLIBCXX_3.4.21
 OBJECT:0:GLIBCXX_3.4.22
 OBJECT:0:GLIBCXX_3.4.23
+OBJECT:0:GLIBCXX_3.4.24
+OBJECT:0:GLIBCXX_3.4.25
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
 OBJECT:0:GLIBCXX_3.4.5
diff --git 
a/libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt 
b/libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt
index f9eab290..e673f4f 100644
--- a/libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt
@@ -444,6 +444,7 @@ 
FUNC:_ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv@GLIBCXX_3.4
 FUNC:_ZNKSt13basic_istreamIwSt11char_traitsIwEE6gcountEv@@GLIBCXX_3.4
 FUNC:_ZNKSt13basic_istreamIwSt11char_traitsIwEE6sentrycvbEv@@GLIBCXX_3.4
 FUNC:_ZNKSt13basic_ostreamIwSt11char_traitsIwEE6sentrycvbEv@@GLIBCXX_3.4
+FUNC:_ZNKSt13random_device13_M_getentropyEv@@GLIBCXX_3.4.25
 FUNC:_ZNKSt13runtime_error4whatEv@@GLIBCXX_3.4
 FUNC:_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE5rdbufEv@@GLIBCXX_3.4
 FUNC:_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv@@GLIBCXX_3.4.5
@@ -1329,6 +1330,7 @@ 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1EPKwRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1EPKwjRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_@@GLIBCXX_3.4
+FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_jRKS1_@@GLIBCXX_3.4.24
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_jj@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_jjRKS1_@@GLIBCXX_3.4
 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC1ESt16initializer_listIwERKS1_@@GLIBCXX_3.4.11
@@ -1342,6 +1344,7 @@ 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2EPKwRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2EPKwjRKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS1_@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_@@GLIBCXX_3.4
+FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_jRKS1_@@GLIBCXX_3.4.24
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_jj@@GLIBCXX_3.4
 FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ERKS2_jjRKS1_@@GLIBCXX_3.4
 
FUNC:_ZNSbIwSt11char_traitsIwESaIwEEC2ESt16initializer_listIwERKS1_@@GLIBCXX_3.4.11
@@ -4002,6 +4005,8 @@ OBJECT:0:GLIBCXX_3.4.20
 OBJECT:0:GLIBCXX_3.4.21
 OBJECT:0:GLIBCXX_3.4.22
 OBJECT:0:GLIBCXX_3.4.23
+OBJECT:0:GLIBCXX_3.4.24
+OBJECT:0:GLIBCXX_3.4.25
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.4
 OBJECT:0:GLIBCXX_3.4.5
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver 
b/libstdc++-v3/config/abi/pre/gnu.ver
index 48e2ec8..7e5a9cc 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1953,6 +1953,7 @@ GLIBCXX_3.4.23 {
     # basic_string<C, T, A>::basic_string(const basic_string&, size_type, 
const A&)
     
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]ERKS4_[jmy]RKS3_;
     _ZNSsC[12]ERKSs[jmy]RKSaIcE;
+    # This should have been _[jmy]RKS1_ not _mRKS1_ (PR libstdc++/81092):
     _ZNSbIwSt11char_traitsIwESaIwEEC[12]ERKS2_mRKS1_;
 
 #ifndef HAVE_EXCEPTION_PTR_SINCE_GCC46
@@ -1969,10 +1970,17 @@ GLIBCXX_3.4.23 {
 
 GLIBCXX_3.4.24 {
 
+    # These should have been in GLIBCXX_3.4.23 (PR libstdc++/81092):
+    _ZNSbIwSt11char_traitsIwESaIwEEC[12]ERKS2_[jy]RKS1_;
+
+} GLIBCXX_3.4.23;
+
+GLIBCXX_3.4.25 {
+
     # std::random_device::_M_getentropy() const
     _ZNKSt13random_device13_M_getentropyEv;
 
-} GLIBCXX_3.4.23;
+} GLIBCXX_3.4.24;
 
 # Symbols in the support library (libsupc++) have their own tag.
 CXXABI_1.3 {
diff --git a/libstdc++-v3/doc/xml/manual/abi.xml 
b/libstdc++-v3/doc/xml/manual/abi.xml
index d17f06e..58950c9 100644
--- a/libstdc++-v3/doc/xml/manual/abi.xml
+++ b/libstdc++-v3/doc/xml/manual/abi.xml
@@ -266,7 +266,8 @@ compatible.
     <listitem><para>GCC 5.1.0: libstdc++.so.6.0.21</para></listitem>
     <listitem><para>GCC 6.1.0: libstdc++.so.6.0.22</para></listitem>
     <listitem><para>GCC 7.1.0: libstdc++.so.6.0.23</para></listitem>
-    <listitem><para>GCC 8.0.0: libstdc++.so.6.0.24</para></listitem>
+    <listitem><para>GCC 7.2.0: libstdc++.so.6.0.24</para></listitem>
+    <listitem><para>GCC 8.0.0: libstdc++.so.6.0.25</para></listitem>
     </itemizedlist>
     <para>
       Note 1: Error should be libstdc++.so.3.0.3.
@@ -335,7 +336,8 @@ compatible.
     <listitem><para>GCC 5.1.0: GLIBCXX_3.4.21, CXXABI_1.3.9</para></listitem>
     <listitem><para>GCC 6.1.0: GLIBCXX_3.4.22, CXXABI_1.3.10</para></listitem>
     <listitem><para>GCC 7.1.0: GLIBCXX_3.4.23, CXXABI_1.3.11</para></listitem>
-    <listitem><para>GCC 8.0.0: GLIBCXX_3.4.24, CXXABI_1.3.11</para></listitem>
+    <listitem><para>GCC 7.2.0: GLIBCXX_3.4.24, CXXABI_1.3.11</para></listitem>
+    <listitem><para>GCC 8.0.0: GLIBCXX_3.4.25, CXXABI_1.3.11</para></listitem>
     </itemizedlist>
     </listitem>
 
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/8.cc 
b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/8.cc
index 6fc4fdf..aceec5c 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/8.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/8.cc
@@ -15,16 +15,31 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-options "-O0" }
 // { dg-do run { target c++11 } }
 
 #include <string>
 #include <testsuite_hooks.h>
 
+struct TestBaseObjCtor : std::string
+{
+  template<typename... Args>
+    TestBaseObjCtor(Args&&... args)
+    : std::string(std::forward<Args>(args)...)
+    { }
+};
+
 template<typename... Args>
 std::size_t
 construct(Args&&... args)
 {
-  return std::string( std::forward<Args>(args)... ).length();
+  // Use static_cast<Args> to produce either an lvalue or prvalue,
+  // so args... not left in moved-from state and can be reused below:
+  TestBaseObjCtor as_base_obj( static_cast<Args>(args)... );
+
+  std::string as_complete_obj( std::forward<Args>(args)... );
+
+  return as_complete_obj.length();
 }
 
 void
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/8.cc 
b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/8.cc
index 0fee578..7345737 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/8.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/8.cc
@@ -15,16 +15,31 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-options "-O0" }
 // { dg-do run { target c++11 } }
 
 #include <string>
 #include <testsuite_hooks.h>
 
+struct TestBaseObjCtor : std::wstring
+{
+  template<typename... Args>
+    TestBaseObjCtor(Args&&... args)
+    : std::wstring(std::forward<Args>(args)...)
+    { }
+};
+
 template<typename... Args>
 std::size_t
 construct(Args&&... args)
 {
-  return std::wstring( std::forward<Args>(args)... ).length();
+  // Use static_cast<Args> to produce either an lvalue or prvalue,
+  // so args... not left in moved-from state and can be reused below:
+  TestBaseObjCtor as_base_obj( static_cast<Args>(args)... );
+
+  std::wstring as_complete_obj( std::forward<Args>(args)... );
+
+  return as_complete_obj.length();
 }
 
 void
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc 
b/libstdc++-v3/testsuite/util/testsuite_abi.cc
index ee7572e..4d7f4ca 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc
@@ -205,6 +205,7 @@ check_version(symbol& test, bool added)
       known_versions.push_back("GLIBCXX_3.4.22");
       known_versions.push_back("GLIBCXX_3.4.23");
       known_versions.push_back("GLIBCXX_3.4.24");
+      known_versions.push_back("GLIBCXX_3.4.25");
       known_versions.push_back("CXXABI_1.3");
       known_versions.push_back("CXXABI_LDBL_1.3");
       known_versions.push_back("CXXABI_1.3.1");
@@ -235,7 +236,7 @@ check_version(symbol& test, bool added)
        test.version_status = symbol::incompatible;
 
       // Check that added symbols are added in the latest pre-release version.
-      bool latestp = (test.version_name == "GLIBCXX_3.4.24"
+      bool latestp = (test.version_name == "GLIBCXX_3.4.25"
                     || test.version_name == "CXXABI_1.3.11"
                     || test.version_name == "CXXABI_FLOAT128"
                     || test.version_name == "CXXABI_TM_1");

Reply via email to