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). Target maintainers will need to regenerate the baseline symbols on gcc-7-branch and trunk. I intend to commit this tomorrow to gcc-7-branch.
commit 425e1d784d9085f0f8d58ef6a381cc73d564f2f5 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 new GLIBCXX_3.4.24 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 8cb525b..805148d 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:23:0 +libtool_VERSION=6:24: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..50f5c25 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 @@ -1329,6 +1329,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 +1343,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 +4004,7 @@ 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.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..50f5c25 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 @@ -1329,6 +1329,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 +1343,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 +4004,7 @@ 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.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 268fb94..f7d6c83 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 @@ -1967,6 +1968,13 @@ GLIBCXX_3.4.23 { } GLIBCXX_3.4.22; +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; + # 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 d086d9e..071997b 100644 --- a/libstdc++-v3/doc/xml/manual/abi.xml +++ b/libstdc++-v3/doc/xml/manual/abi.xml @@ -266,6 +266,7 @@ 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 7.2.0: libstdc++.so.6.0.24</para></listitem> </itemizedlist> <para> Note 1: Error should be libstdc++.so.3.0.3. @@ -334,6 +335,7 @@ 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 7.2.0: GLIBCXX_3.4.24, 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 f5fc594..ee7572e 100644 --- a/libstdc++-v3/testsuite/util/testsuite_abi.cc +++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc @@ -204,6 +204,7 @@ check_version(symbol& test, bool added) known_versions.push_back("GLIBCXX_LDBL_3.4.21"); 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("CXXABI_1.3"); known_versions.push_back("CXXABI_LDBL_1.3"); known_versions.push_back("CXXABI_1.3.1"); @@ -234,7 +235,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.23" + bool latestp = (test.version_name == "GLIBCXX_3.4.24" || test.version_name == "CXXABI_1.3.11" || test.version_name == "CXXABI_FLOAT128" || test.version_name == "CXXABI_TM_1");