Bug 50349 - /usr/bin/ld: warning: wildcard match appears in both version 'GLIBCXX_3.4' and 'CXXABI_1.3' in script
Summary: /usr/bin/ld: warning: wildcard match appears in both version 'GLIBCXX_3.4' an...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.6.2
: P3 normal
Target Milestone: 4.7.0
Assignee: Benjamin Kosnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-10 18:31 UTC by Pawel Sikora
Modified: 2012-02-24 20:25 UTC (History)
1 user (show)

See Also:
Host: x86_64-gnu-linux
Target: x86_64-gnu-linux
Build: x86_64-gnu-linux
Known to work:
Known to fail:
Last reconfirmed: 2012-02-21 00:00:00


Attachments
build log. (71.19 KB, application/octet-stream)
2012-02-16 23:09 UTC, Pawel Sikora
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2011-09-10 18:31:56 UTC
during native gcc-4.6 bootstrap the linker reports few warnings
on libstdc++-symbols.ver script:

(...)
/usr/bin/ld: warning: wildcard match appears in both version 'GLIBCXX_3.4' and 'CXXABI_1.3' in script
/usr/bin/ld: warning: using 'GLIBCXX_3.4' as version for 'std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::str() const' which is also named in version 'GLIBCXX_3.4.6' in script
/usr/bin/ld: warning: using 'GLIBCXX_3.4' as version for 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_disjunct(char const*) const' which is also named in version 'GLIBCXX_3.4.5' in script
/usr/bin/ld: warning: using 'GLIBCXX_3.4' as version for 'std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_disjunct(wchar_t const*) const' which is also named in version 'GLIBCXX_3.4.5' in script
Comment 1 Benjamin Kosnik 2012-02-16 20:36:33 UTC
I am unable to reproduce this on F16, 

GNU ld version 2.21.53.0.1-6.fc16 20110716
Copyright 2011 Free Software Foundation, Inc.

Can you give me some more information about your ld, and include any special flags used to get the warnings. Thanks.
Comment 2 Pawel Sikora 2012-02-16 23:09:45 UTC
Created attachment 26687 [details]
build log.
Comment 3 Pawel Sikora 2012-02-16 23:10:34 UTC
(In reply to comment #1)
> I am unable to reproduce this on F16, 
> 
> GNU ld version 2.21.53.0.1-6.fc16 20110716
> Copyright 2011 Free Software Foundation, Inc.
> 
> Can you give me some more information about your ld, and include any special
> flags used to get the warnings. Thanks.

you need to use ld-gold for gcc build and configure gcc with --enable-symvers=gnu.
the problem is in the libstdc++-v3/config/abi/pre/gnu.ver:

grep shows duplicated lines:

gnu.ver:    _ZNKSs11_M_disjunctEPKc;
gnu.ver:    _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw;
gnu.ver:    _ZNKSs11_M_disjunctEPKc;
gnu.ver:    _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw;

full build log attached.
Comment 4 Benjamin Kosnik 2012-02-21 20:07:30 UTC
confirmed with gcc-trunk and gold as:

%ld --version
GNU gold (GNU Binutils 2.22.52.20120220) 1.11
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: wildcard match appears in both version 'GLIBCXX_3.4' and 'CXXABI_1.3' in script
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: wildcard match appears in both version 'CXXABI_1.3' and 'CXXABI_TM_1' in script
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: using 'GLIBCXX_3.4' as version for '_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv' which is also named in version 'GLIBCXX_3.4.6' in script
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: using 'GLIBCXX_3.4' as version for '_ZNKSs11_M_disjunctEPKc' which is also named in version 'GLIBCXX_3.4.5' in script
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: using 'GLIBCXX_3.4' as version for '_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw' which is also named in version 'GLIBCXX_3.4.5' in script
Comment 5 Benjamin Kosnik 2012-02-21 23:46:55 UTC
Author: bkoz
Date: Tue Feb 21 23:46:49 2012
New Revision: 184453

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184453
Log:
2012-02-17  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/50349
	* config/abi/pre/gnu.ver: Only one local.
	* config/abi/pre/gnu-versioned-namespace.ver: Same.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
    trunk/libstdc++-v3/config/abi/pre/gnu.ver
Comment 6 Benjamin Kosnik 2012-02-21 23:50:01 UTC
Fixed:
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: wildcard match
appears in both version 'GLIBCXX_3.4' and 'CXXABI_1.3' in script
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: wildcard match
appears in both version 'CXXABI_1.3' and 'CXXABI_TM_1' in script

With patch.

The rest:
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: using
'GLIBCXX_3.4' as version for
'_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv' which is also named
in version 'GLIBCXX_3.4.6' in script
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: using
'GLIBCXX_3.4' as version for '_ZNKSs11_M_disjunctEPKc' which is also named in
version 'GLIBCXX_3.4.5' in script
/mnt/share/bin/H-x86_64-binutils.20120220-gold/bin/ld: warning: using
'GLIBCXX_3.4' as version for
'_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw' which is also named in
version 'GLIBCXX_3.4.5' in script

are correct warnings, but the symbols are correct. This is symbol hiding, and gold warns for this but GNU ld does not. Doesn't matter, binary is still the same.