From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43074 invoked by alias); 6 Jan 2019 17:25:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 43053 invoked by uid 89); 6 Jan 2019 17:25:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Jan 2019 17:25:36 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A780F811DA; Sun, 6 Jan 2019 17:25:35 +0000 (UTC) Received: from localhost (unknown [10.33.36.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A62D5D9D6; Sun, 6 Jan 2019 17:25:34 +0000 (UTC) Date: Sun, 06 Jan 2019 17:25:00 -0000 From: Jonathan Wakely To: Rainer Orth Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Export explicit instantiations for C++17 members of std::string Message-ID: <20190106172534.GK15627@redhat.com> References: <20190104232416.GA26926@redhat.com> <20190106171826.GJ15627@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190106171826.GJ15627@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-01/txt/msg00245.txt.bz2 On 06/01/19 17:18 +0000, Jonathan Wakely wrote: >On 06/01/19 17:59 +0100, Rainer Orth wrote: >>Hi Jonathan, >> >>>The C++17 standard added some new members to std::basic_string, which >>>were not previously instantiated in the library. This meant that the >>>extern template declarations had to be disabled for C++17 mode. With >>>this patch the new members are instantiated in the library and so the >>>explicit instantiation declarations can be used for C++17. >>> >>>The new members added by C++2a are still not exported, and so the >>>explicit instantiation declarations are still disabled for C++2a. >>> >>> * config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Make patterns less greedy >>> for const member functions of std::basic_string. >>> (GLIBCXX_3.4.26): Export member functions of std::basic_string added >>> in C++17. >>> * include/bits/basic_string.h (basic_string(__sv_wrapper, const A&)): >>> Make non-standard constructor private. >>> [!_GLIBCXX_USE_CXX11_ABI] (basic_string(__sv_wrapper, const A&)): >>> Likewise. >>> * include/bits/basic_string.tcc (std::string, std::wstring): Declare >>> explicit instantiations for C++17 as well as earlier dialects. >>> * src/c++17/Makefile.am: Add new source files. >>> * src/c++17/Makefile.in: Regenerate. >>> * src/c++17/cow-string-inst.cc: New file defining explicit >>> instantiations for basic_string member functions added in C++17. >>> * src/c++17/string-inst.cc: Likewise. >>> >>>Tested powerpc64le-linux, committed to trunk. >> >>this patch broke Solaris bootstrap: >> >>ld: fatal: libstdc++-symbols.ver-sun: 6705: symbol 'std::basic_string, std::allocator >::operator std::basic_string_view >() const': symbol version conflict >>ld: fatal: libstdc++-symbols.ver-sun: 6707: symbol 'std::basic_string, std::allocator >::operator std::basic_string_view >() const': symbol version conflict >>ld: fatal: libstdc++-symbols.ver-sun: 6712: symbol 'std::basic_string, std::allocator >::data()': symbol version conflict >>ld: fatal: libstdc++-symbols.ver-sun: 6714: symbol 'std::basic_string, std::allocator >::data()': symbol version conflict >>ld: fatal: libstdc++-symbols.ver-sun: 6723: symbol 'std::__cxx11::basic_string, std::allocator >::_S_to_string_view(std::basic_string_view >)': symbol version conflict >>ld: fatal: libstdc++-symbols.ver-sun: 6724: symbol 'std::__cxx11::basic_string, std::allocator >::_S_to_string_view(std::basic_string_view >)': symbol version conflict >>collect2: error: ld returned 1 exit status >>make[6]: *** [Makefile:696: libstdc++.la] Error 1 > >Sorry :-( > >[...] > >>The following patch allowed the build to finish. > >OK for trunk, thanks. > >I'll make sure to run my script to check for such conflicts before >adding any more symbols. The good news is that even with my soon-to-be-committed changes, I only see the same problems you already found: Symbol matches more than one version: _ZNKSbIwSt11char_traitsIwESaIwEEcvSt17basic_string_viewIwS0_EEv std::basic_string, std::allocator >::operator std::basic_string_view >() const GLIBCXX_3.4 _ZNKSbIwSt11char_traitsIwESaIwEE[a-z]* (line 327) GLIBCXX_3.4.26 _ZNKSbIwSt11char_traitsIwESaIwEEcvSt17basic_string_viewIwS0_EEv (line 2098) Symbol matches more than one version: _ZNKSscvSt17basic_string_viewIcSt11char_traitsIcEEEv std::basic_string, std::allocator >::operator std::basic_string_view >() const GLIBCXX_3.4 _ZNKSs[a-z]* (line 261) GLIBCXX_3.4.26 _ZNKSscvSt17basic_string_viewIcSt11char_traitsIcEEEv (line 2097) Symbol matches more than one version: _ZNSbIwSt11char_traitsIwESaIwEE4dataEv std::basic_string, std::allocator >::data() GLIBCXX_3.4 _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][c-e]* (line 287) GLIBCXX_3.4.26 _ZNSbIwSt11char_traitsIwESaIwEE4dataEv (line 2102) Symbol matches more than one version: _ZNSs4dataEv std::basic_string, std::allocator >::data() GLIBCXX_3.4 _ZNSs[0-58-9][c-e]* (line 220) GLIBCXX_3.4.26 _ZNSs4dataEv (line 2101) Symbol matches more than one version: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE17_S_to_string_viewESt17basic_string_viewIcS2_E std::__cxx11::basic_string, std::allocator >::_S_to_string_view(std::basic_string_view >) GLIBCXX_3.4.21 _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE1[5-9]* (line 1720) GLIBCXX_3.4.26 _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE17_S_to_string_viewESt17basic_string_viewI[cw]S2_E (line 2107) Symbol matches more than one version: _ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE17_S_to_string_viewESt17basic_string_viewIwS2_E std::__cxx11::basic_string, std::allocator >::_S_to_string_view(std::basic_string_view >) GLIBCXX_3.4.21 _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE1[5-9]* (line 1720) GLIBCXX_3.4.26 _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE17_S_to_string_viewESt17basic_string_viewI[cw]S2_E (line 2107)