Skip to content

Commit c93eab8

Browse files
committed
x86/x86_64: fix compatibility with bionic headers
glibc and musl use a static block of memory for storing floating-point registers, while bionic uses a structure instead. no functional change ref #78 ref termux/termux-packages#27605 Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
1 parent fe31f95 commit c93eab8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/x86/makecontext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int arg
3636
sp -= uc_link;
3737
sp = (libucontext_greg_t *) (((uintptr_t) sp & -16L) - 8);
3838

39-
ucp->uc_mcontext.fpregs = (void *) &ucp->__fpregs_mem[0];
39+
ucp->uc_mcontext.fpregs = (void *) &ucp->__fpregs_mem;
4040
ucp->uc_mcontext.gregs[REG_EIP] = (uintptr_t) func;
4141
ucp->uc_mcontext.gregs[REG_EBX] = (uintptr_t) argc;
4242
ucp->uc_mcontext.gregs[REG_ESP] = (uintptr_t) sp;

arch/x86_64/makecontext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int arg
3636
sp -= uc_link;
3737
sp = (libucontext_greg_t *) (((uintptr_t) sp & -16L) - 8);
3838

39-
ucp->uc_mcontext.fpregs = (void *) &ucp->__fpregs_mem[0];
39+
ucp->uc_mcontext.fpregs = (void *) &ucp->__fpregs_mem;
4040
ucp->uc_mcontext.gregs[REG_RIP] = (uintptr_t) func;
4141
ucp->uc_mcontext.gregs[REG_RBX] = (uintptr_t) &sp[uc_link];
4242
ucp->uc_mcontext.gregs[REG_RSP] = (uintptr_t) sp;

0 commit comments

Comments
 (0)