mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Fix aarch64 setjmp abi
We now store values in jmp_buf where the compiler wants them to be. This fixes code that calls __builtin_setjmp() and __builtin_longjmp() such as libunwind. All libcxxabi tests are now passing on ARM64. See #1076
This commit is contained in:
parent
21093044c0
commit
6ab01716ce
5 changed files with 15 additions and 19 deletions
|
@ -43,13 +43,13 @@ _longjmp:
|
|||
mov 48(%rdi),%r15
|
||||
jmp *56(%rdi)
|
||||
#elif defined(__aarch64__)
|
||||
ldp x19,x20,[x0,#0]
|
||||
ldp x21,x22,[x0,#16]
|
||||
ldp x29,x30,[x0,#0]
|
||||
ldp x2,x22,[x0,#16]
|
||||
ldp x23,x24,[x0,#32]
|
||||
ldp x25,x26,[x0,#48]
|
||||
ldp x27,x28,[x0,#64]
|
||||
ldp x29,x30,[x0,#80]
|
||||
ldr x2,[x0,#104]
|
||||
ldp x19,x20,[x0,#80]
|
||||
ldr x21,[x0,#104]
|
||||
mov sp,x2
|
||||
ldp d8 ,d9,[x0,#112]
|
||||
ldp d10,d11,[x0,#128]
|
||||
|
|
|
@ -44,14 +44,14 @@ _setjmp:
|
|||
xor %eax,%eax
|
||||
ret
|
||||
#elif defined(__aarch64__)
|
||||
stp x19,x20,[x0,#0]
|
||||
stp x21,x22,[x0,#16]
|
||||
mov x2,sp
|
||||
stp x29,x30,[x0,#0]
|
||||
stp x2,x22,[x0,#16]
|
||||
stp x23,x24,[x0,#32]
|
||||
stp x25,x26,[x0,#48]
|
||||
stp x27,x28,[x0,#64]
|
||||
stp x29,x30,[x0,#80]
|
||||
mov x2,sp
|
||||
str x2,[x0,#104]
|
||||
stp x19,x20,[x0,#80]
|
||||
str x21,[x0,#104]
|
||||
stp d8,d9,[x0,#112]
|
||||
stp d10,d11,[x0,#128]
|
||||
stp d12,d13,[x0,#144]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue