diff mbox

Implement move semantics for iostreams

Message ID 20140924144825.GW2669@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Sept. 24, 2014, 2:48 p.m. UTC
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<char,
>>> std::char_traits<char> >::move(std::basic_ios<char,
>>> std::char_traits<char> >&&)': 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<wchar_t, std::char_traits<wchar_t> >::basic_ostream(std::basic_iostream<wchar_t, std::char_traits<wchar_t> >&)': symbol version conflict
>ld: fatal: libstdc++-symbols.ver-sun: 4623: symbol 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::basic_ostream(std::basic_iostream<wchar_t, std::char_traits<wchar_t> >&)': 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

>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.

Comments

Rainer Orth Sept. 25, 2014, 11:05 a.m. UTC | #1
Hi Jonathan,

>>almost there: now I only get
>>
>>ld: fatal: libstdc++-symbols.ver-sun: 4622: symbol 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::basic_ostream(std::basic_iostream<wchar_t, std::char_traits<wchar_t> >&)': symbol version conflict
>>ld: fatal: libstdc++-symbols.ver-sun: 4623: symbol 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::basic_ostream(std::basic_iostream<wchar_t, std::char_traits<wchar_t> >&)': 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<wchar_t>
>     _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;

it does: {i386-pc, sparc-sun}-solaris2.1[01] bootstraps completed
successfully with it.

Thanks for the quick fix.

	Rainer
Jonathan Wakely Sept. 25, 2014, 11:17 a.m. UTC | #2
On 25/09/14 13:05 +0200, Rainer Orth wrote:
>Hi Jonathan,
>
>>>almost there: now I only get
>>>
>>>ld: fatal: libstdc++-symbols.ver-sun: 4622: symbol 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::basic_ostream(std::basic_iostream<wchar_t, std::char_traits<wchar_t> >&)': symbol version conflict
>>>ld: fatal: libstdc++-symbols.ver-sun: 4623: symbol 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::basic_ostream(std::basic_iostream<wchar_t, std::char_traits<wchar_t> >&)': 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<wchar_t>
>>     _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;
>
>it does: {i386-pc, sparc-sun}-solaris2.1[01] bootstraps completed
>successfully with it.

Great. I hope the slightly-modified version I eventually checked in
still works too :)
Rainer Orth Sept. 25, 2014, 5:28 p.m. UTC | #3
Hi Jonathan,

>>it does: {i386-pc, sparc-sun}-solaris2.1[01] bootstraps completed
>>successfully with it.
>
> Great. I hope the slightly-modified version I eventually checked in
> still works too :)

it does indeed, as just verified by a i386-pc-solaris2.11 bootstrap :-)

	Rainer
diff mbox

Patch

--- 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<wchar_t>
     _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;