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]

[PATCH][gold] compiling gold with libc++ and __stl_hash_string


Hi all,

I've tried to compile gold with clang and libc++. I ran into an issue
with __stl_hash_string. With the following patch, gold compiles.


diff --git a/gold/system.h b/gold/system.h
index 3e6fe1d..e84b87f 100644
--- a/gold/system.h
+++ b/gold/system.h
@@ -97,6 +97,9 @@ struct hash<off_t> : public
std::unary_function<off_t, std::size_t>
 #define Unordered_map __gnu_cxx::hash_map
 #define Unordered_multimap __gnu_cxx::hash_multimap

+// libc++ does not have __stl_hash_string, but uses std::hash
+// for hash_map, etc.
+#if !defined(_LIBCPP_VERSION)
 namespace __gnu_cxx
 {

@@ -117,6 +120,7 @@ struct hash<T*>
 };

 }
+#endif // !defined(_LIBCPP_VERSION)

 #define reserve_unordered_map(map, n) ((map)->resize(n))


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