This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gold patch rfa] avoid tr1/unordered_map et al. if rehash method doesn't work.


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.

Attachment: rehash.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]