diff --git a/libgccjit.version b/libgccjit.version index 62417a80f82..442c948bff5 100644 --- a/libgccjit.version +++ b/libgccjit.version @@ -1 +1 @@ -badf78d09d16e66f4ca07971c51aa6a227558d4f +01118deaae56c126b12501fc65bfb7e3ed4e35b0 diff --git a/patches/0002-Use-integer-types-for-_Unwind_Ptr-and-_Unwind_Word.patch b/patches/0002-Use-integer-types-for-_Unwind_Ptr-and-_Unwind_Word.patch new file mode 100644 index 00000000000..a09bcadc0c3 --- /dev/null +++ b/patches/0002-Use-integer-types-for-_Unwind_Ptr-and-_Unwind_Word.patch @@ -0,0 +1,116 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: None +Date: Thu, 27 Aug 2026 18:00:00 -0400 +Subject: [PATCH] Use integer types for _Unwind_Ptr and _Unwind_Word + +--- +diff --git a/library/panic_unwind/src/gcc.rs b/library/panic_unwind/src/gcc.rs +index adcbe51..56d520a 100644 +--- a/library/panic_unwind/src/gcc.rs ++++ b/library/panic_unwind/src/gcc.rs +@@ -63,7 +63,7 @@ pub(crate) unsafe fn panic(data: Box) -> u32 { + _uwe: uw::_Unwind_Exception { + exception_class: RUST_EXCEPTION_CLASS, + exception_cleanup: Some(exception_cleanup), +- private: [core::ptr::null(); _], ++ private: [0; _], + }, + canary: &CANARY, + cause: data, +diff --git a/library/std/src/sys/personality/gcc.rs b/library/std/src/sys/personality/gcc.rs +index 0e20a41..22be57d 100644 +--- a/library/std/src/sys/personality/gcc.rs ++++ b/library/std/src/sys/personality/gcc.rs +@@ -41,6 +41,7 @@ use unwind as uw; + + use super::dwarf::eh::{self, EHAction, EHContext}; + use crate::ffi::c_int; ++use crate::ptr; + + // Register ids were lifted from LLVM's TargetLowering::getExceptionPointerRegister() + // and TargetLowering::getExceptionSelectorRegister() for each architecture, +@@ -138,7 +139,7 @@ cfg_select! { + // take only the context pointer, GCC personality routines stash a pointer to + // exception_object in the context, using location reserved for ARM's + // "scratch register" (r12). +- uw::_Unwind_SetGR(context, uw::UNWIND_POINTER_REG, exception_object as uw::_Unwind_Ptr); ++ uw::_Unwind_SetGR(context, uw::UNWIND_POINTER_REG, exception_object.expose_provenance()); + // ...A more principled approach would be to provide the full definition of ARM's + // _Unwind_Context in our libunwind bindings and fetch the required data from there + // directly, bypassing DWARF compatibility functions. +@@ -169,10 +170,10 @@ cfg_select! { + uw::_Unwind_SetGR( + context, + UNWIND_DATA_REG.0, +- exception_object as uw::_Unwind_Ptr, ++ exception_object.expose_provenance(), + ); +- uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, core::ptr::null()); +- uw::_Unwind_SetIP(context, lpad); ++ uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, 0); ++ uw::_Unwind_SetIP(context, lpad.expose_provenance()); + return uw::_URC_INSTALL_CONTEXT; + } + EHAction::Terminate => return uw::_URC_FAILURE, +@@ -265,11 +266,11 @@ cfg_select! { + uw::_Unwind_SetGR( + context, + UNWIND_DATA_REG.0, +- exception_object.cast(), ++ exception_object.expose_provenance(), + ); +- uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, core::ptr::null()); ++ uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, 0); + let maybe_signed_lpad = sign_lpad(context, lpad); +- uw::_Unwind_SetIP(context, maybe_signed_lpad); ++ uw::_Unwind_SetIP(context, maybe_signed_lpad.expose_provenance()); + uw::_URC_INSTALL_CONTEXT + } + EHAction::Terminate => uw::_URC_FATAL_PHASE2_ERROR, +@@ -360,10 +361,14 @@ unsafe fn find_eh_action(context: *mut uw::_Unwind_Context) -> Result 5, +-- +2.49.0 diff --git a/tests/lang_tests.rs b/tests/lang_tests.rs index 7ec0ab877b0..ebce05a0597 100644 --- a/tests/lang_tests.rs +++ b/tests/lang_tests.rs @@ -299,10 +299,7 @@ fn run_tests(tempdir: PathBuf, c_objects_dir: PathBuf, current_dir: String) { "[DEBUG] lang run", "tests/run", TestMode::CompileAndRun, - &[ - // FIXME: remove this when the unwind issue is fixed in GCC m68k upstream. - "catch_unwind.rs", - ], + &[], ); build_test_runner( tempdir, @@ -312,10 +309,7 @@ fn run_tests(tempdir: PathBuf, c_objects_dir: PathBuf, current_dir: String) { "[RELEASE] lang run", "tests/run", TestMode::CompileAndRun, - &[ - // FIXME: remove this when the unwind issue is fixed in GCC m68k upstream. - "catch_unwind.rs", - ], + &[], ); }