[gold patch rfa] avoid tr1/unordered_map et al. if rehash method doesn't work.
Chris Demetriou
cgd@google.com
Fri Apr 24 05:52:00 GMT 2009
Some versions of GCC seem to have a <tr1/unordered_map> but don't have
a working rehash method, e.g., the GCC from Ubuntu Dapper: gcc version
4.0.3 (Ubuntu 4.0.3-1ubuntu5).
Using that compiler:
#include <tr1/unordered_map>
void bar() { ::std::tr1::unordered_map<int, int> x; x.rehash(10); }
int main() { return 0; }
gets a link failure:
/tmp/ccZD8llW.o: In function `bar()':
:(.text+0x78): undefined reference to `std::tr1::hashtable<int,
std::pair<int const, int>, std::allocator<std::pair<int const, int> >,
Internal::extract1st<std::pair<int const, int> >, std::equal_to<int>,
std::tr1::hash<int>, Internal::mod_range_hashing,
Internal::default_ranged_hash, Internal::prime_rehash_policy, false,
true, true>::rehash(unsigned int)'
This causes a gold build to choke with that compiler, after the
2009-04-01 patch.
Tested this change with that compiler (where rehash is detected as
bad), and with a GCC 4.2.2-based compiler on the same system (where
rehash is detected as working).
chris
----
2009-04-23 Chris Demetriou <cgd@google.com>
* configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
* configure: Regenerate.
* config.in: Regenerate.
* gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rehash.patch
Type: application/octet-stream
Size: 5173 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090424/86db646e/attachment.obj>
More information about the Binutils
mailing list