guix-mirrors/gnu/packages/patches/gcc-libstdc++-newer-gcc.patch
Ludovic Courtès 42f7c1bb17
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
2025-07-18 20:17:34 +02:00

32 lines
1.3 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)
{