From ac623ff4034caeee28f423ae7800e8516cbc0078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Sanz=20Gonz=C3=A1lez?= <80487270+hsanzg@users.noreply.github.com> Date: Wed, 19 Aug 2026 19:40:05 +0200 Subject: [PATCH] Double-word align `_Unwind_Exception` --- library/unwind/src/types.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/unwind/src/types.rs b/library/unwind/src/types.rs index 7634052c93f33..d745b836e822b 100644 --- a/library/unwind/src/types.rs +++ b/library/unwind/src/types.rs @@ -42,6 +42,12 @@ pub const unwinder_private_data_size: usize = cfg_select! { }; #[repr(C)] +// The Itanium C++ ABI requires this type to have "double-word" alignment, +// which libunwind and libgcc interpret as the maximum alignment of any +// scalar type on the current target. +#[cfg_attr(target_pointer_width = "16", repr(align(4)))] +#[cfg_attr(target_pointer_width = "32", repr(align(8)))] +#[cfg_attr(target_pointer_width = "64", repr(align(16)))] pub struct _Unwind_Exception { pub exception_class: _Unwind_Exception_Class, pub exception_cleanup: _Unwind_Exception_Cleanup_Fn,