On Fri, 11 Apr 2025, Jacek Caban wrote:
Instead of for specific architectures. Fixes setjmp on ARM64EC.
---
mingw-w64-headers/crt/setjmp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mingw-w64-headers/crt/setjmp.h b/mingw-w64-headers/crt/setjmp.h
index 2dc7d8739..f5208a0dc 100644
--- a/mingw-w64-headers/crt/setjmp.h
+++ b/mingw-w64-headers/crt/setjmp.h
@@ -230,7 +230,7 @@ void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp
(void);
int __cdecl __attribute__ ((__nothrow__,__returns_twice__))
__mingw_setjmp(jmp_buf _Buf);
__MINGW_ATTRIB_NORETURN __attribute__ ((__nothrow__)) void
__mingw_longjmp(jmp_buf _Buf,int _Value);
# elif defined(__SEH__) && !defined(__USE_MINGW_SETJMP_NON_SEH)
-# if defined(__aarch64__) || defined(_ARM64_) || defined(__arm__) ||
defined(_ARM_)
+# if __has_builtin(__builtin_sponentry)
# define setjmp(BUF) _setjmp((BUF), __builtin_sponentry())
# elif (__MINGW_GCC_VERSION < 40702) && !defined(__clang__)
# define setjmp(BUF) _setjmp((BUF), mingw_getsp())
--
2.49.0
I guess this is ok, assuming that regular x86_64 doesn't expose
__builtin_sponentry(), and/or that the value returned from it also is
suitable there too?
The conditional a couple lines above this is quite messy as well, I wonder
if there's something we could do to simplify it a little? We do want to
keep allow users to set __USE_MINGW_SETJMP_NON_SEH, but the other concerns
checked in it might not be very relevant any longer. Or would this be
simpler if we'd just reorder this to come after the main __SEH__ case?
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public