Implement signal handler tail recursion

GNU Make on Windows now appears to be working reliably. This change also
fixes a bug where, after fork the Windows thread handle wasn't reset and
that caused undefined behavior using SetThreadContext() with our signals
This commit is contained in:
Justine Tunney 2023-10-14 10:29:26 -07:00
parent a657f3e878
commit cdf556e7d2
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
15 changed files with 627 additions and 77 deletions

View file

@ -0,0 +1,18 @@
#include "libc/nt/codegen.h"
.imp psapi,__imp_EnumProcessModules,EnumProcessModules
.text.windows
.ftrace1
EnumProcessModules:
.ftrace2
#ifdef __x86_64__
push %rbp
mov %rsp,%rbp
mov __imp_EnumProcessModules(%rip),%rax
jmp __sysv2nt
#elif defined(__aarch64__)
mov x0,#0
ret
#endif
.endfn EnumProcessModules,globl
.previous