Fix MODE=aarch64 build

This commit is contained in:
Justine Tunney 2023-06-08 05:17:28 -07:00
parent 8767e9ad6a
commit 7512318a2a
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 96 additions and 80 deletions

View file

@ -24,6 +24,7 @@
#include "libc/calls/struct/siginfo.h"
#include "libc/calls/ucontext.h"
#include "libc/intrin/likely.h"
#include "libc/log/libfatal.internal.h"
#include "libc/math.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/sa.h"
@ -41,7 +42,7 @@ privileged void __sigenter_wsl(int sig, struct siginfo *info, ucontext_t *ctx) {
ctx->uc_mcontext.fpregs = &ctx->__fpustate;
for (i = 0; i < 8; ++i) {
long double nan = NAN;
__builtin_memcpy(ctx->__fpustate.st + i, &nan, 16);
__memcpy(ctx->__fpustate.st + i, &nan, 16);
}
}
((sigaction_f)(__executable_start + rva))(sig, info, ctx);

View file

@ -453,7 +453,7 @@ static privileged void linuxthreadstate2xnu(
static privileged void CopyFpXmmRegs(void *d, const void *s) {
size_t i;
for (i = 0; i < (8 + 16) * 16; i += 16) {
__builtin_memcpy((char *)d + i, (const char *)s + i, 16);
__memcpy((char *)d + i, (const char *)s + i, 16);
}
}
@ -527,7 +527,8 @@ privileged void __sigenter_xnu(void *fn, int infostyle, int sig,
}
#elif defined(__aarch64__)
if (xnuctx->uc_mcontext) {
memcpy(g.uc.uc_mcontext.regs, &xnuctx->uc_mcontext->__ss.__x, 33 * 8);
__memcpy(g.uc.uc_mcontext.regs, &xnuctx->uc_mcontext->__ss.__x,
33 * 8);
}
#endif /* __x86_64__ */
}
@ -561,7 +562,8 @@ privileged void __sigenter_xnu(void *fn, int infostyle, int sig,
}
#elif defined(__aarch64__)
if (xnuctx->uc_mcontext) {
memcpy(&xnuctx->uc_mcontext->__ss.__x, g.uc.uc_mcontext.regs, 33 * 8);
__memcpy(&xnuctx->uc_mcontext->__ss.__x, g.uc.uc_mcontext.regs,
33 * 8);
}
#endif /* __x86_64__ */
}