fc5871
From efd5bc0715e5477318be95a76811cda0a89e8289 Mon Sep 17 00:00:00 2001
fc5871
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
fc5871
Date: Fri, 4 Mar 2022 12:00:26 +0100
fc5871
Subject: [PATCH] GLIBCXX fix for GCC 12?
fc5871
fc5871
---
fc5871
 build/unix/stdc++compat/stdc++compat.cpp | 14 ++++++++++++++
fc5871
 1 file changed, 14 insertions(+)
fc5871
fc5871
diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp
fc5871
index 0180f6bcfa998..8d7a542ff11f0 100644
fc5871
--- a/build/unix/stdc++compat/stdc++compat.cpp
fc5871
+++ b/build/unix/stdc++compat/stdc++compat.cpp
fc5871
@@ -24,6 +24,7 @@
fc5871
    GLIBCXX_3.4.27 is from gcc 10
fc5871
    GLIBCXX_3.4.28 is from gcc 10
fc5871
    GLIBCXX_3.4.29 is from gcc 11
fc5871
+   GLIBCXX_3.4.30 is from gcc 12
fc5871
 
fc5871
 This file adds the necessary compatibility tricks to avoid symbols with
fc5871
 version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with
fc5871
@@ -69,6 +70,19 @@ void __attribute__((weak)) __throw_bad_array_new_length() { MOZ_CRASH(); }
fc5871
 }  // namespace std
fc5871
 #endif
fc5871
 
fc5871
+#if _GLIBCXX_RELEASE >= 12
fc5871
+namespace std {
fc5871
+
fc5871
+/* This avoids the GLIBCXX_3.4.30 symbol version. */
fc5871
+void __attribute__((weak))
fc5871
+__glibcxx_assert_fail(const char* __file, int __line, const char* __function,
fc5871
+                      const char* __condition) {
fc5871
+  MOZ_CRASH();
fc5871
+}
fc5871
+
fc5871
+}  // namespace std
fc5871
+#endif
fc5871
+
fc5871
 /* While we generally don't build with exceptions, we have some host tools
fc5871
  * that do use them. libstdc++ from GCC 5.0 added exception constructors with
fc5871
  * char const* argument. Older versions only have a constructor with
fc5871
-- 
fc5871
2.35.1
fc5871