Bug 14309 - gold doesn't build with gcc 4.1.3
Summary: gold doesn't build with gcc 4.1.3
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-29 08:42 UTC by Jakub Jelinek
Modified: 2012-07-13 17:12 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Fix the compilation error (1.36 KB, patch)
2012-07-02 19:19 UTC, Dodji Seketeli
Details | Diff
Cleanup to avoid a warning with GCC 4.1.2 (564 bytes, patch)
2012-07-02 19:27 UTC, Dodji Seketeli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2012-06-29 08:42:53 UTC
gold/README says:
The gold source code uses templates heavily.  Building it requires a
recent version of g++.  g++ 4.0.3 and 4.1.3 are known to work.  g++
3.2, 3.4.3, and 4.1.2 are known to fail.
and I used to be able to build 2.22.52.0.1 just fine with gcc-4.1.2-RH (which is based on 137441 of FSF branches/gcc-4_1-branch (no libstdc++ changes on that branch after that revision).  But 2.22.52.0.4 no longer builds with it:

/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable: In instantiation of 'Internal::hash_code_base<long long int, std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, std::equal_to<long long int>, std::tr1::hash<long long int>, Internal::mod_range_hashing, Internal::default_ranged_hash, false>':
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:1014:   instantiated from 'std::tr1::hashtable<long long int, std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, std::equal_to<long long int>, std::tr1::hash<long long int>, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, false, false, true>'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/unordered_map:63:   instantiated from 'std::tr1::unordered_map<long long int, gold::Gdb_index_info_reader::Declaration_pair, std::tr1::hash<long long int>, std::equal_to<long long int>, std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, false>'
gdb-index.cc:292:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:863: error: 'Internal::hash_code_base<Key, Value, ExtractKey, Equal, H1, H2, Internal::default_ranged_hash, false>::m_h1' has incomplete type
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functional:1101: error: declaration of 'struct std::tr1::hash<long long int>'
gdb-index.cc: In constructor 'std::tr1::unordered_map<Key, T, Hash, Pred, Alloc, cache_hash_code>::unordered_map(typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::size_type, const typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::hasher&, const typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::key_equal&, const typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::allocator_type&) [with Key = long long int, T = gold::Gdb_index_info_reader::Declaration_pair, Hash = std::tr1::hash<long long int>, Pred = std::equal_to<long long int>, Alloc = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, bool cache_hash_code = false]':
gdb-index.cc:189: error: invalid use of undefined type 'struct std::tr1::hash<long long int>'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/functional:1101: error: declaration of 'struct std::tr1::hash<long long int>'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable: In member function 'size_t Internal::hash_code_base<Key, Value, ExtractKey, Equal, H1, H2, Internal::default_ranged_hash, false>::m_hash_code(const Key&) const [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing]':
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:1541:   instantiated from 'typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::iterator std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::find(const Key&) [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, Allocator = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool constant_iterators = false, bool unique_keys = true]'
gdb-index.cc:696:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:829: error: using invalid field 'Internal::hash_code_base<Key, Value, ExtractKey, Equal, H1, H2, Internal::default_ranged_hash, false>::m_h1'
output.h:2816: warning: 'class gold::Output_fill' has virtual functions but non-virtual destructor
output.h:2852: warning: 'class gold::Output_fill_debug_info' has virtual functions but non-virtual destructor
output.h:2876: warning: 'class gold::Output_fill_debug_line' has virtual functions but non-virtual destructor
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable: In constructor 'Internal::hash_code_base<Key, Value, ExtractKey, Equal, H1, H2, Internal::default_ranged_hash, false>::hash_code_base(const ExtractKey&, const Equal&, const H1&, const H2&, const Internal::default_ranged_hash&) [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing]':
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:1392:   instantiated from 'std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::hashtable(typename Allocator::size_type, const H1&, const H2&, const H&, const Eq&, const Ex&, const Allocator&) [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, Allocator = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool constant_iterators = false, bool unique_keys = true]'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/unordered_map:86:   instantiated from 'std::tr1::unordered_map<Key, T, Hash, Pred, Alloc, cache_hash_code>::unordered_map(typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::size_type, const typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::hasher&, const typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::key_equal&, const typename std::tr1::hashtable<Key, std::pair<const Key, T>, Alloc, Internal::extract1st<std::pair<const Key, T> >, Pred, Hash, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, cache_hash_code, false, true>::allocator_type&) [with Key = long long int, T = gold::Gdb_index_info_reader::Declaration_pair, Hash = std::tr1::hash<long long int>, Pred = std::equal_to<long long int>, Alloc = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, bool cache_hash_code = false]'
gdb-index.cc:189:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:823: error: using invalid field 'Internal::hash_code_base<Key, Value, ExtractKey, Equal, H1, H2, Internal::default_ranged_hash, false>::m_h1'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable: In member function 'size_t Internal::hash_code_base<Key, Value, ExtractKey, Equal, H1, H2, Internal::default_ranged_hash, false>::bucket_index(const Internal::hash_node<Value, false>*, size_t) const [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing]':
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:1927:   instantiated from 'void std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::m_rehash(typename Allocator::size_type) [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, Allocator = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool constant_iterators = false, bool unique_keys = true]'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:1684:   instantiated from 'typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::iterator std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::m_insert_bucket(const Value&, typename Allocator::size_type, typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::hash_code_t) [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, Allocator = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool constant_iterators = false, bool unique_keys = true]'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:1716:   instantiated from 'std::pair<typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::iterator, bool> std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::m_insert(const Value&, std::tr1::true_type) [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, Allocator = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool constant_iterators = false, bool unique_keys = true]'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:1248:   instantiated from 'typename Internal::IF<unique_keys, std::pair<Internal::hashtable_iterator<Value, constant_iterators, cache_hash_code>, bool>, Internal::hashtable_iterator<Value, constant_iterators, cache_hash_code> >::type std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, constant_iterators, unique_keys>::insert(const Value&) [with Key = long long int, Value = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, Allocator = std::allocator<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, ExtractKey = Internal::extract1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, Equal = std::equal_to<long long int>, H1 = std::tr1::hash<long long int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool constant_iterators = false, bool unique_keys = true]'
gdb-index.cc:715:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/tr1/hashtable:837: error: using invalid field 'Internal::hash_code_base<Key, Value, ExtractKey, Equal, H1, H2, Internal::default_ranged_hash, false>::m_h1'
make[4]: *** [gdb-index.o] Error 1

If I force the HAVE_TR1_UNORDERED_MAP_REHASH configure check to fail, it still doesn't build:
usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ext/hashtable.h: In member function 'size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num_key(const _Key&, size_t) const [with _Val = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, _Key = long long int, _HashFcn = __gnu_cxx::hash<long long int>, _ExtractKey = std::_Select1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, _EqualKey = std::equal_to<long long int>, _Alloc = std::allocator<gold::Gdb_index_info_reader::Declaration_pair>]':
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ext/hashtable.h:588:   instantiated from 'size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num_key(const _Key&) const [with _Val = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, _Key = long long int, _HashFcn = __gnu_cxx::hash<long long int>, _ExtractKey = std::_Select1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, _EqualKey = std::equal_to<long long int>, _Alloc = std::allocator<gold::Gdb_index_info_reader::Declaration_pair>]'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ext/hashtable.h:511:   instantiated from '__gnu_cxx::_Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc> __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::find(const _Key&) [with _Val = std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair>, _Key = long long int, _HashFcn = __gnu_cxx::hash<long long int>, _ExtractKey = std::_Select1st<std::pair<const long long int, gold::Gdb_index_info_reader::Declaration_pair> >, _EqualKey = std::equal_to<long long int>, _Alloc = std::allocator<gold::Gdb_index_info_reader::Declaration_pair>]'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ext/hash_map:225:   instantiated from 'typename __gnu_cxx::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::iterator __gnu_cxx::hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>::find(const typename __gnu_cxx::hashtable<std::pair<const _Key, _Tp>, _Key, _HashFcn, std::_Select1st<std::pair<const _Key, _Tp> >, _EqualKey, _Alloc>::key_type&) [with _Key = long long int, _Tp = gold::Gdb_index_info_reader::Declaration_pair, _HashFcn = __gnu_cxx::hash<long long int>, _EqualKey = std::equal_to<long long int>, _Alloc = std::allocator<gold::Gdb_index_info_reader::Declaration_pair>]'
gdb-index.cc:696:   instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/ext/hashtable.h:596: error: no match for call to '(const __gnu_cxx::hash<long long int>) (const long long int&)'
make[4]: *** [gdb-index.o] Error 1
Comment 1 H.J. Lu 2012-06-30 12:40:09 UTC
The minimum is GCC 4.2.4.
Comment 2 Jakub Jelinek 2012-07-02 05:52:18 UTC
That is not a documented minimum is still that 4.1.3 and until gdb_index.cc stuff has been added it worked just fine.  GCC 4.1.x is still widely deployed as a system compiler, and having very high GCC requirements is counter-productive, you usually need to build new binutils in order to build new gcc, with this requirement you are forcing everybody to first build new binutils without gold, then new gcc, then build again new binutils and possibly build new gcc again.
Comment 3 Dodji Seketeli 2012-07-02 19:15:03 UTC
I think the problem comes from the fact that libstdc++ in GCC 4.1.2 does not define a specialization for std::tr1::hash<long long>.

But that specialization is needed when you want to use a 'long long' as a key type in a std::tr1::unordered_map.

I am attaching a patch that hopefully addresses the issue on platforms that provide std::tr1::unordered_map but don't provide std::tr1::hash<long long>.
Comment 4 Dodji Seketeli 2012-07-02 19:19:35 UTC
Created attachment 6507 [details]
Fix the compilation error

Provide the std::tr1::hash<long long> specialization when not available.
Comment 5 Dodji Seketeli 2012-07-02 19:27:10 UTC
Created attachment 6508 [details]
Cleanup to avoid a warning with GCC 4.1.2

This is a cleanup patch to avoid a warning I came accross while building Gold with GCC 4.1.2.
Comment 6 Jakub Jelinek 2012-07-03 06:39:19 UTC
The relevant upstream libstdc++-v3 change seems to be
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118991
I guess alternatively gold could (with the same configure check) just cast the long long vals to long or unsigned long before hashing, after all, that is exactly what libstdc++ does with it.
Comment 7 Sourceware Commits 2012-07-10 14:54:35 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	ian@sourceware.org	2012-07-10 14:54:30

Modified files:
	gold           : ChangeLog config.in configure configure.ac 
	                 gold.h output.h 

Log message:
	PR gold/14309
	* configure.ac: Test whether std::tr1::hash<off_t> works.
	* gold.h: Add a specialization for std::tr1::hash<off_t> if
	needed.
	* output.h (class Output_fill): Add virtual destructor.
	* configure, config.in: Rebuild.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.924&r2=1.925
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/config.in.diff?cvsroot=src&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/configure.diff?cvsroot=src&r1=1.77&r2=1.78
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/configure.ac.diff?cvsroot=src&r1=1.74&r2=1.75
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/gold.h.diff?cvsroot=src&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/output.h.diff?cvsroot=src&r1=1.134&r2=1.135
Comment 8 Ian Lance Taylor 2012-07-10 14:55:35 UTC
Fixed.
Comment 9 H.J. Lu 2012-07-11 09:07:37 UTC
I got

/net/gnu-6/export/linux/src/binutils/binutils/gold/incremental-dump.cc
/net/gnu-6/export/linux/src/binutils/binutils/gold/x86_64.cc: In instantiation of \u2018const int <unnamed>::Output_data_plt_x86_64<64>::plt_eh_frame_cie_size\u2019:
/net/gnu-6/export/linux/src/binutils/binutils/gold/x86_64.cc:331:   instantiated from \u2018void<unnamed>::Output_data_plt_x86_64_standard<size>::do_add_eh_frame(gold::Layout*) [with int size = 64]\u2019
/net/gnu-6/export/linux/src/binutils/binutils/gold/x86_64.cc:4802:   instantiated from here
/net/gnu-6/export/linux/src/binutils/binutils/gold/x86_64.cc:260: internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:5067
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.

with

gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
Comment 10 Ian Lance Taylor 2012-07-11 11:49:52 UTC
The gold README says that GCC 4.1.2 is known to fail and GCC 4.1.3 is known to work.  I think it's useful to ensure that gold compile with 4.1.x, but given that 4.1.3 works I don't think it's useful to work around compiler bugs in 4.1.2.
Comment 11 Jakub Jelinek 2012-07-11 11:54:33 UTC
(In reply to comment #10)
> The gold README says that GCC 4.1.2 is known to fail and GCC 4.1.3 is known to
> work.  I think it's useful to ensure that gold compile with 4.1.x, but given
> that 4.1.3 works I don't think it's useful to work around compiler bugs in
> 4.1.2.

GCC 4.1.2-RH is based on FSF GCC 4.1.3 prerelease (note, GCC 4.1.3 has actually never been released).  That said, we built internally gold just fine using that compiler with Dodji's patch, perhaps we are using different options.
Comment 12 H.J. Lu 2012-07-13 17:12:48 UTC
GCC Red Hat 4.1.2-52 works on x86-64. But on ia32, I got

g++ -W -Wall    -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fmerge-constants -g -O2   -o ver_matching_def.so -O0 -Bgcctestdir/ -shared ver_matching_def_pic.o -Wl,--version-script=/net/gnu-6/export/linux/src/binutils/binutils/gold/testsuite/version_script.map
Link of protected_4.so should have failed