summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2015-12-02 00:47:24 -0600
committertrav90 <travawine@protonmail.ch>2015-12-02 00:47:24 -0600
commit8123324dc20793705c90b450e3c107626d9bb4d4 (patch)
treee03def3d1dc2bffb053829daf7215d0f437ece79 /build
parent95476e43f2b3204b62c38d788a379c3f5ea713db (diff)
downloadpalemoon-gre-8123324dc20793705c90b450e3c107626d9bb4d4.tar.gz
Add stdc++-compat hack for std::string::_S_compare and std::runtime_error::runtime_error (for GCC 5.0)
Diffstat (limited to 'build')
-rw-r--r--build/unix/stdc++compat/stdc++compat.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp
index f95c7befb..a77a6173b 100644
--- a/build/unix/stdc++compat/stdc++compat.cpp
+++ b/build/unix/stdc++compat/stdc++compat.cpp
@@ -21,7 +21,8 @@
GLIBCXX_3.4.17 is from gcc 4.7.0 (174383)
GLIBCXX_3.4.18 is from gcc 4.8.0 (190787)
GLIBCXX_3.4.19 is from gcc 4.8.1 (199309)
- GLIBCXX_3.4.20 is from gcc 4.9.0 (199307) */
+ GLIBCXX_3.4.20 is from gcc 4.9.0 (199307)
+ GLIBCXX_3.4.21 is from gcc 5.0 (210290) */
#define GLIBCXX_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c))
@@ -59,9 +60,14 @@ namespace std {
template wstring& wstring::assign(wstring&&);
#endif /* __GXX_EXPERIMENTAL_CXX0X__ */
#endif /* (__GNUC__ == 4) && (__GNUC_MINOR__ >= 5) */
+#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 16)
+ /* Instantiate these templates to avoid GLIBCXX_3.4.16 symbol versions
+ * depending on compiler optimizations */
+ template int string::_S_compare(size_type, size_type);
+#endif
}
-namespace std __attribute__((visibility("default"))) {
+namespace std MOZ_EXPORT {
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 14)
/* Hack to avoid GLIBCXX_3.4.14 symbol versions */
struct _List_node_base
@@ -166,3 +172,16 @@ __cxa_throw_bad_array_new_length()
MOZ_CRASH();
}
#endif
+
+#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 21)
+/* While we generally don't build with exceptions, we have some host tools
+ * that do use them. libstdc++ from GCC 5.0 added exception constructors with
+ * char const* argument. Older versions only have a constructor with
+ * std::string. */
+namespace std {
+ runtime_error::runtime_error(char const* s)
+ : runtime_error(std::string(s))
+ {
+ }
+}
+#endif