summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/gcc-libstdc++-newer-gcc.patch
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2025-06-11 23:21:04 +0200
committerAndreas Enge <andreas@enge.fr>2025-07-18 20:17:34 +0200
commit42f7c1bb176253ebea47c84077303bb14f62fbed (patch)
tree2af9e842a34f95418e87f9dd077d0734c940c0d0 /gnu/packages/patches/gcc-libstdc++-newer-gcc.patch
parentca8e8e206b3e687af56bc623e9439c9f5358c12a (diff)
gnu: gcc: Fix compilation of libstdc++ for GCC 7 to 13.
With the introduction of GCC 14 as the default compiler, compilation of libstdc++ of all previous versions would fail due to a different signature for ‘__cxa_call_terminate’ (a builtin in GCC 14). This fixes it. * gnu/packages/patches/gcc-libstdc++-newer-gcc.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gcc.scm (gcc-7, gcc-8, gcc-9, gcc-10) (gcc-11, gcc-12, gcc-13): Use it. Change-Id: I84dc26e46d56259d7d610f19b0521fa9c5499d5e
Diffstat (limited to 'gnu/packages/patches/gcc-libstdc++-newer-gcc.patch')
-rw-r--r--gnu/packages/patches/gcc-libstdc++-newer-gcc.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/packages/patches/gcc-libstdc++-newer-gcc.patch b/gnu/packages/patches/gcc-libstdc++-newer-gcc.patch
new file mode 100644
index 0000000000..9f643ef8f6
--- /dev/null
+++ b/gnu/packages/patches/gcc-libstdc++-newer-gcc.patch
@@ -0,0 +1,32 @@
+Building this file with GCC 14 leads to this error:
+
+ ../../libstdc++-v3/libsupc++/eh_call.cc:39:1: warning: new declaration ‘void __cxa_call_terminate(_Unwind_Exception*)’ ambiguates built-in declaration ‘void __cxa_call_terminate(void*)’ [-Wbuiltin-declaration-mismatch]
+ 39 | __cxa_call_terminate(_Unwind_Exception* ue_header) throw ()
+ | ^~~~~~~~~~~~~~~~~~~~
+ ../../libstdc++-v3/libsupc++/eh_call.cc: In function ‘void __cxa_call_terminate(_Unwind_Exception*)’:
+ ../../libstdc++-v3/libsupc++/eh_call.cc:39:1: internal compiler error: in gimple_build_eh_must_not_throw, at gimple.cc:730
+ 0x7fbc43241bd6 __libc_start_call_main
+ ???:0
+ 0x7fbc43241c94 __libc_start_main_alias_1
+ ???:0
+ Please submit a full bug report, with preprocessed source.
+ Please include the complete backtrace with any bug report.
+ See <https://gcc.gnu.org/bugs/> for instructions.
+
+Work around it.
+
+diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc
+index bf864f692..4f7ade71e 100644
+--- a/libstdc++-v3/libsupc++/eh_call.cc
++++ b/libstdc++-v3/libsupc++/eh_call.cc
+@@ -36,8 +36,9 @@ using namespace __cxxabiv1;
+ // terminate.
+
+ extern "C" void
+-__cxa_call_terminate(_Unwind_Exception* ue_header) throw ()
++__cxa_call_terminate(void *arg) throw ()
+ {
++ _Unwind_Exception *ue_header = (_Unwind_Exception *) arg;
+
+ if (ue_header)
+ {