在 2026-11-10 22:07, Pali Rohár 写道:
The other is that libucrtapp.a doesn't have `_longjmpex`. I see there are
already patches in this series for ucrtapp, so you may have a look and try
fixing that.

In later commits in this my series which I sent is already a patch which
adds _longjmpex implementation for ucrtapp. So libucrtapp.a will have it
and there is also CI test for ucrtapp in later changes which verifies it.

I see. However patch 18 'crt: Change amd64, arm32 and arm64 longjmp()' deletes longjmp.S, rendering all changes temporary. I'll try checking 13-17 in first.

Patch 13 reuses parts of `_setjmp3`. There's an issue that it pops the argument for dllimport'd `_setjmp` from the stack into ECX, which doesn't conform to the ABI; the argument is considered destroyed after a function returns. That specific hunk should look like

 #if defined(__i386__)
 __MINGW_USYMBOL(_setjmp3):
+#ifdef I386_SETJMP3_ONLY
+        /* local setjmp_common function is not being compiled, and we have 
only CRT _setjmp function */
+        /* _setjmp always inspects SEH try_level and we will overwrite 
jmp_buf.TryLevel below if needed */
+        pushl   4(%esp)
+        calll   *__MINGW_USYMBOL(__MINGW_IMP_SYMBOL(_setjmp))
+        addl    $4,%esp
+        movl    4(%esp),%ecx         /* jmp_buf */
+#else
         /* edx == -1 -> setjmp_common will NOT inspect SEH try_level */
         /* edx != -1 -> setjmp_common will inspect SEH try_level */
/* Do not inspect SEH try_level when _Count >= 2 -> means that try_level is provided as _TryLevel param */
@@ -71,6 +83,7 @@ __MINGW_USYMBOL(_setjmp3):
         pushl   4(%esp)
         calll   __MINGW_LSYMBOL(setjmp_common)
         popl    %ecx                 /* jmp_buf */
+#endif

I'll look into the remaining changes tomorrow.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to