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