From patchwork Wed Sep 24 22:15:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 393122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B6E281400AB for ; Thu, 25 Sep 2014 08:16:05 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=mdYm/04QeAQQDZSw4 q1h0XjyzSthC6+KuZKYvciXyRodGkIBlwSnNnjMn8U0N3ZA3GYGLlwU4fANUh5de r2rnmFYSGclHSAday9xWWSJKHxh1RecvP7eofSyzS3CDIzoqirUAN0Qe7229uxkb c/B+N98x3x1ou0ANV4n7K8DaE0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=alaIJclxsmOvIBs5srrXu9G e4uw=; b=TjfEScRJawt9paU7/gQtUqsj5lIzcUMxzbQJcLPbgsqORFEC5DWy2zW hNPiBAQKty68JS9mnDzKQtJCDr9bUyDL3lVPkxemu7k4LXSFXb9mpoz6WR1fQ4VJ TONFEVZbf4PWKnacCtKaLugUlnrvkLLT+5w/9LzKZvz2K6bzf/rk= Received: (qmail 29986 invoked by alias); 24 Sep 2014 22:15:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29967 invoked by uid 89); 24 Sep 2014 22:15:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 24 Sep 2014 22:15:46 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8OMFeF0000592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 24 Sep 2014 18:15:40 -0400 Received: from localhost (ovpn-116-40.ams2.redhat.com [10.36.116.40]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8OMFcgu025759; Wed, 24 Sep 2014 18:15:40 -0400 Date: Wed, 24 Sep 2014 23:15:38 +0100 From: Jonathan Wakely To: Rainer Orth Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [patch] Implement move semantics for iostreams Message-ID: <20140924221538.GY2669@redhat.com> References: <20140922133507.GF22778@redhat.com> <20140924133727.GU2669@redhat.com> <20140924144825.GW2669@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140924144825.GW2669@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) On 24/09/14 15:48 +0100, Jonathan Wakely wrote: >On 24/09/14 16:38 +0200, Rainer Orth wrote: >>Hi Jonathan, >> >>>On 23/09/14 15:58 +0200, Rainer Orth wrote: >>>>This patch broke Solaris bootstrap with Sun ld: when linking >>>>libstdc++.so, ld complains >>>> >>>>ld: fatal: libstdc++-symbols.ver-sun: 4520: symbol 'std::basic_ios>>>std::char_traits >::move(std::basic_ios>>>std::char_traits >&&)': symbol version conflict >>>> >>>>and many more. In that case, I find that this symbols is matched by >>>>both the GLIBCXX_3.4 and GLIBCXX_3.4.21 patterns: >>>> >>>> GLIBCXX_3.4 >>>> ##std::basic_i[g-r]* (cxx) >>>> _ZNSt9basic_iosIcSt11char_traitsIcEE4moveEOS2_; >>>> >>>> GLIBCXX_3.4.21 >>>> ##_ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE4moveE[OR]S2_ (glob) >>>> _ZNSt9basic_iosIcSt11char_traitsIcEE4moveEOS2_; >>> >>>Rainer, I think this patch should fix it, could you test it please? >> >>almost there: now I only get >> >>ld: fatal: libstdc++-symbols.ver-sun: 4622: symbol 'std::basic_ostream >::basic_ostream(std::basic_iostream >&)': symbol version conflict >>ld: fatal: libstdc++-symbols.ver-sun: 4623: symbol 'std::basic_ostream >::basic_ostream(std::basic_iostream >&)': symbol version conflict >> >>from >> >> GLIBCXX_3.4: >> >> ##_ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]E[RP]* (glob) >> _ZNSt13basic_ostreamIwSt11char_traitsIwEEC1ERSt14basic_iostreamIwS1_E; >> _ZNSt13basic_ostreamIwSt11char_traitsIwEEC2ERSt14basic_iostreamIwS1_E; >> >> GLIBCXX_3.4.21: >> >> ##_ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]ERSt14basic_iostreamIwS1_E (glob) >> _ZNSt13basic_ostreamIwSt11char_traitsIwEEC1ERSt14basic_iostreamIwS1_E; >> _ZNSt13basic_ostreamIwSt11char_traitsIwEEC2ERSt14basic_iostreamIwS1_E; > >Doh, yes, this additional tweak should solve that: > >index f736240..95fc3c7 100644 >--- a/libstdc++-v3/config/abi/pre/gnu.ver >+++ b/libstdc++-v3/config/abi/pre/gnu.ver >@@ -460,7 +460,7 @@ GLIBCXX_3.4 { > > # std::basic_ostream > _ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]Ev; >- _ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]E[RP]*; >+ _ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]EP*; > _ZNSt13basic_ostreamIwSt11char_traitsIwEED*; > _ZNKSt13basic_ostreamIwSt11char_traitsIwEE[0-9][a-z]*; > _ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw; > >>The glob in the 3.4 version also matches >> >> _ZNSt13basic_ostreamIwSt11char_traitsIwEEC1EPSt15basic_streambufIwS1_E; >> _ZNSt13basic_ostreamIwSt11char_traitsIwEEC2EPSt15basic_streambufIwS1_E; > >Yes, that's all it needs to match, so changing [RP] to just P should work. > >>>(I tried installing Solaris in a VM but couldn't get it to work, maybe >>>I should use the VirtualBox image instead of trying qemu/kvm.) >> >>VirtualBox works for me in principle, but I often found bootstrapping >>gcc inside some VM almost intolerably slow... There's been some talk on >>getting Solaris up and running in the compile farm. > >That would be very useful. > >Thanks for the quick testing and analysis. I'm committing this, which has one additional change to the basic_ios patterns, so it won't match basic_ios<>::operator bool() when I add that back. Tested x86_64-linux, committed to trunk. I'm tempted to tidy up the GLIBCXX_3.4 patterns in the linker script quite considerably, there's no point these kind of patterns in there: std::basic_o[g-r]*; std::basic_ostr[a-d]*; They don't match anything today, and if we add new symbols that match them we wouldn't want them to get the GLIBCXX_3.4 version anyway! commit c9f582474ee89860ab4999c360b5cc32a936a104 Author: redi Date: Wed Sep 24 22:13:29 2014 +0000 * config/abi/pre/gnu.ver: Make GLIBCXX_3.4 patterns stricter so the new GLIBCXX_3.4.21 symbols don't match them. diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index 58c90d6..63985fd 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -39,10 +39,11 @@ GLIBCXX_3.4 { std::basic_[g-h]*; std::basic_i[a-e]*; # std::basic_ifstream; - std::basic_i[g-r]*; +# std::basic_ios; +# std::basic_iostream; std::basic_istr[a-d]*; # std::basic_istream; - std::basic_istr[f-z]*; +# std::basic_istringstream; std::basic_i[t-z]*; std::basic_[j-n]*; std::basic_o[a-e]*; @@ -50,12 +51,12 @@ GLIBCXX_3.4 { # std::basic_o[g-z]*; std::basic_o[g-r]*; std::basic_ostr[a-d]*; - std::basic_ostr[f-z]*; +# std::basic_ostringstream; std::basic_[p-r]*; # std::basic_streambuf # std::basic_string # std::basic_stringbuf - std::basic_stringstream*; +# std::basic_stringstream; std::basic_[t-z]*; std::ba[t-z]*; std::b[b-z]*; @@ -94,7 +95,7 @@ GLIBCXX_3.4 { std::i[p-r]*; # std::istream # std::istreambuf_iterator - std::istringstream*; +# std::istringstream*; std::istrstream*; std::i[t-z]*; std::[A-Zj-k]*; @@ -306,12 +307,14 @@ GLIBCXX_3.4 { # std::basic_streambuf _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[CD]*; _ZNKSt15basic_streambufI[cw]St11char_traitsI[cw]EE[0-9]*; - _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[0-9][a-z][^t]*; + _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE4set[gp]*; + _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE4sync*; + _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[5-9][a-z][^t]*; _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[0-9][0-9][a-z][^t]*; _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EEaSERKS2_; # std::basic_stringbuf - _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC*; + _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]E[RS]*; _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EED[^2]*; _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9][a-r]*; _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9]seek*; @@ -325,12 +328,48 @@ GLIBCXX_3.4 { _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9]_M_[q-z]*; _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9][0-9]_M_[a-z]*; - # std::basic_iostream constructors, destructors - _ZNSdC*; + # std::basic_istringstream + _ZNSt19basic_istringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]E[RS]*; + _ZNSt19basic_istringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EED*; + _ZNSt19basic_istringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3str*; + _ZNKSt19basic_istringstream*; + + # std::basic_ostringstream + _ZNSt19basic_ostringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]E[RS]*; + _ZNSt19basic_ostringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EED*; + _ZNSt19basic_ostringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3str*; + _ZNKSt19basic_ostringstream*; + + # std::basic_stringstream + _ZNSt18basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]E[RS]*; + _ZNSt18basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EED*; + _ZNSt18basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3str*; + _ZNKSt18basic_stringstream*; + + # std::basic_iostream constructors (except move), destructors + _ZNSdC[12]Ev; + _ZNSdC[12]EP*; _ZNSdD*; + _ZNSt14basic_iostreamIwSt11char_traitsIwEEC[12]Ev; + _ZNSt14basic_iostreamIwSt11char_traitsIwEEC[12]EP*; + _ZNSt14basic_iostreamIwSt11char_traitsIwEED*; + + # std::basic_ios constructors, destructors + _ZNSt9basic_iosI[cw]St11char_traitsI[cw]EEC*; + _ZNSt9basic_iosI[cw]St11char_traitsI[cw]EED*; + + # std::basic_ios members (except move, swap, set_rdbuf) + _ZNKSt9basic_iosI[cw]St11char_traitsI[cw]EEcvPvEv; + _ZNKSt9basic_iosI[cw]St11char_traitsI[cw]EEntEv*; + _ZNKSt9basic_iosI[cw]St11char_traitsI[cw]EE[0-9]*; + _ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE1[015]*; + _ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE3tie*; + _ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE4fill*; + _ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE4init*; + _ZNSt9basic_iosI[cw]St11char_traitsI[cw]EE[578][a-z]*; # std::basic_filebuf - _ZNSt13basic_filebufI[cw]St11char_traitsI[cw]EEC*; + _ZNSt13basic_filebufI[cw]St11char_traitsI[cw]EEC[12]Ev; _ZNSt13basic_filebufI[cw]St11char_traitsI[cw]EED*; _ZNSt13basic_filebufI[cw]St11char_traitsI[cw]EE0*; _ZNSt13basic_filebufI[cw]St11char_traitsI[cw]EE13*; @@ -372,23 +411,34 @@ GLIBCXX_3.4 { _ZNKSt14basic_ofstreamI[cw]St11char_traitsI[cw]EE5rdbufEv; # std::basic_istream - _ZNSiC*; + _ZNSiC[12]Ev; + _ZNSiC[12]EP*; _ZNSiD*; - _ZNKSi[0-9][a-z]*; - _ZNSi[0-9][a-h]*; - _ZNSi[0-9][j-z]*; + _ZNKSi6sentry*; + _ZNKSi6gcount*; + _ZNSi3get*; + _ZNSi4peek*; + _ZNSi4read*; + _ZNSi4sync*; + _ZNSi7getline*; + _ZNSi[5-9][j-z]*; # 'x' here and below matches 'long long' where it # is used for signed sizetypes on LLP64 platforms. _ZNSi6ignoreE[ilx][ilx]; _ZNSirsE*[^g]; # std::basic_istream - _ZNSt13basic_istreamIwSt11char_traitsIwEEC*; + _ZNSt13basic_istreamIwSt11char_traitsIwEEC[12]Ev; + _ZNSt13basic_istreamIwSt11char_traitsIwEEC[12]EP*; _ZNSt13basic_istreamIwSt11char_traitsIwEED*; _ZNKSt13basic_istreamIwSt11char_traitsIwEE[0-9][a-z]*; - _ZNSt13basic_istreamIwSt11char_traitsIwEE[0-9][a-h]*; - _ZNSt13basic_istreamIwSt11char_traitsIwEE[0-9][j-z]*; + _ZNSt13basic_istreamIwSt11char_traitsIwEE3get*; + _ZNSt13basic_istreamIwSt11char_traitsIwEE4peek*; + _ZNSt13basic_istreamIwSt11char_traitsIwEE4read*; + _ZNSt13basic_istreamIwSt11char_traitsIwEE4sync*; + _ZNSt13basic_istreamIwSt11char_traitsIwEE[5-9][j-z]*; _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreE[ilx][ijlmx]; + _ZNSt13basic_istreamIwSt11char_traitsIwEE7getline*; _ZNSt13basic_istreamIwSt11char_traitsIwEErsE*[^g]; # std::istream operators and extractors @@ -402,15 +452,18 @@ GLIBCXX_3.4 { _ZStrsIf[cw]St11char_traitsI[cw]EERSt13basic_istream*; # std::basic_ostream - _ZNSoC*; + _ZNSoC[12]Ev; + _ZNSoC[12]EP*; _ZNSoD*; _ZNKSo6sentrycvbEv; _ZNSo8_M_writeEPKc[ilx]; - _ZNSo[0-9][a-z]*; + _ZNSo3put*; + _ZNSo[5-9][a-z]*; _ZNSolsE*[^g]; # std::basic_ostream - _ZNSt13basic_ostreamIwSt11char_traitsIwEEC*; + _ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]Ev; + _ZNSt13basic_ostreamIwSt11char_traitsIwEEC[12]EP*; _ZNSt13basic_ostreamIwSt11char_traitsIwEED*; _ZNKSt13basic_ostreamIwSt11char_traitsIwEE[0-9][a-z]*; _ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw;