Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bd385f3

Browse files
committedMar 12, 2025
Fix panic handler for cygwin
1 parent 9cab8c2 commit bd385f3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎library/std/src/sys/personality/gcc.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ cfg_if::cfg_if! {
248248
}
249249

250250
cfg_if::cfg_if! {
251-
if #[cfg(all(windows, any(target_arch = "aarch64", target_arch = "x86_64"), target_env = "gnu"))] {
251+
if #[cfg(any(
252+
all(windows, any(target_arch = "aarch64", target_arch = "x86_64"), target_env = "gnu"),
253+
target_os = "cygwin",
254+
))] {
252255
/// personality fn called by [Windows Structured Exception Handling][windows-eh]
253256
///
254257
/// On x86_64 and AArch64 MinGW targets, the unwinding mechanism is SEH,

‎library/unwind/src/libunwind.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ pub type _Unwind_Trace_Fn =
2727
#[cfg(target_arch = "x86")]
2828
pub const unwinder_private_data_size: usize = 5;
2929

30-
#[cfg(all(target_arch = "x86_64", not(target_os = "windows")))]
30+
#[cfg(all(target_arch = "x86_64", not(any(target_os = "windows", target_os = "cygwin"))))]
3131
pub const unwinder_private_data_size: usize = 2;
3232

33-
#[cfg(all(target_arch = "x86_64", target_os = "windows"))]
33+
#[cfg(all(target_arch = "x86_64", any(target_os = "windows", target_os = "cygwin")))]
3434
pub const unwinder_private_data_size: usize = 6;
3535

3636
#[cfg(all(target_arch = "arm", not(target_vendor = "apple")))]
@@ -289,7 +289,10 @@ if #[cfg(all(target_vendor = "apple", not(target_os = "watchos"), target_arch =
289289
} // cfg_if!
290290

291291
cfg_if::cfg_if! {
292-
if #[cfg(all(windows, any(target_arch = "aarch64", target_arch = "x86_64"), target_env = "gnu"))] {
292+
if #[cfg(any(
293+
all(windows, any(target_arch = "aarch64", target_arch = "x86_64"), target_env = "gnu"),
294+
target_os = "cygwin",
295+
))] {
293296
// We declare these as opaque types. This is fine since you just need to
294297
// pass them to _GCC_specific_handler and forget about them.
295298
pub enum EXCEPTION_RECORD {}

0 commit comments

Comments
 (0)
Failed to load comments.