mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-28 01:34:43 +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
|
@ -66,7 +66,7 @@ set -- --regex-c='/^extern [^(]*(\*const \([^)]*\))(/\1/b' "$@"
|
||||||
# struct WorstSoftwareEver;
|
# struct WorstSoftwareEver;
|
||||||
set -- --regex-c='/^struct.*;$/uehocruehcroue/b' "$@"
|
set -- --regex-c='/^struct.*;$/uehocruehcroue/b' "$@"
|
||||||
|
|
||||||
exec $TAGS \
|
build/run $TAGS \
|
||||||
-e \
|
-e \
|
||||||
--langmap=c:.c.h \
|
--langmap=c:.c.h \
|
||||||
--exclude=libc/nt/struct/imagefileheader.internal.h \
|
--exclude=libc/nt/struct/imagefileheader.internal.h \
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if printf '%s\n' "$*" | grep aarch64 >/dev/null 2>&1; then
|
UNAMEM=$(uname -m)
|
||||||
if [ ! -f o/third_party/qemu/qemu-aarch64 ]; then
|
UNAMES=$(uname -s)
|
||||||
make -j8 o/third_party/qemu/qemu-aarch64
|
if [ x"$UNAMES" = x"Darwin" ] && [ x"$UNAMEM" = x"arm64" ]; then
|
||||||
fi
|
exec ape "$@"
|
||||||
exec o/third_party/qemu/qemu-aarch64 "$@"
|
|
||||||
else
|
else
|
||||||
exec "$@"
|
exec "$@"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -43,13 +43,13 @@ _longjmp:
|
||||||
mov 48(%rdi),%r15
|
mov 48(%rdi),%r15
|
||||||
jmp *56(%rdi)
|
jmp *56(%rdi)
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
ldp x19,x20,[x0,#0]
|
ldp x29,x30,[x0,#0]
|
||||||
ldp x21,x22,[x0,#16]
|
ldp x2,x22,[x0,#16]
|
||||||
ldp x23,x24,[x0,#32]
|
ldp x23,x24,[x0,#32]
|
||||||
ldp x25,x26,[x0,#48]
|
ldp x25,x26,[x0,#48]
|
||||||
ldp x27,x28,[x0,#64]
|
ldp x27,x28,[x0,#64]
|
||||||
ldp x29,x30,[x0,#80]
|
ldp x19,x20,[x0,#80]
|
||||||
ldr x2,[x0,#104]
|
ldr x21,[x0,#104]
|
||||||
mov sp,x2
|
mov sp,x2
|
||||||
ldp d8 ,d9,[x0,#112]
|
ldp d8 ,d9,[x0,#112]
|
||||||
ldp d10,d11,[x0,#128]
|
ldp d10,d11,[x0,#128]
|
||||||
|
|
|
@ -44,14 +44,14 @@ _setjmp:
|
||||||
xor %eax,%eax
|
xor %eax,%eax
|
||||||
ret
|
ret
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
stp x19,x20,[x0,#0]
|
mov x2,sp
|
||||||
stp x21,x22,[x0,#16]
|
stp x29,x30,[x0,#0]
|
||||||
|
stp x2,x22,[x0,#16]
|
||||||
stp x23,x24,[x0,#32]
|
stp x23,x24,[x0,#32]
|
||||||
stp x25,x26,[x0,#48]
|
stp x25,x26,[x0,#48]
|
||||||
stp x27,x28,[x0,#64]
|
stp x27,x28,[x0,#64]
|
||||||
stp x29,x30,[x0,#80]
|
stp x19,x20,[x0,#80]
|
||||||
mov x2,sp
|
str x21,[x0,#104]
|
||||||
str x2,[x0,#104]
|
|
||||||
stp d8,d9,[x0,#112]
|
stp d8,d9,[x0,#112]
|
||||||
stp d10,d11,[x0,#128]
|
stp d10,d11,[x0,#128]
|
||||||
stp d12,d13,[x0,#144]
|
stp d12,d13,[x0,#144]
|
||||||
|
|
5
third_party/libcxxabi/test/BUILD.mk
vendored
5
third_party/libcxxabi/test/BUILD.mk
vendored
|
@ -1,8 +1,6 @@
|
||||||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
||||||
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘
|
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘
|
||||||
|
|
||||||
ifeq ($(MODE), )
|
|
||||||
|
|
||||||
PKGS += THIRD_PARTY_LIBCXXABI_TEST
|
PKGS += THIRD_PARTY_LIBCXXABI_TEST
|
||||||
|
|
||||||
THIRD_PARTY_LIBCXXABI_TEST_A = o/$(MODE)/third_party/libcxxabi/test/test.a
|
THIRD_PARTY_LIBCXXABI_TEST_A = o/$(MODE)/third_party/libcxxabi/test/test.a
|
||||||
|
@ -109,6 +107,7 @@ THIRD_PARTY_LIBCXXABI_TEST_CHECKS = \
|
||||||
|
|
||||||
THIRD_PARTY_LIBCXXABI_TEST_DIRECTDEPS = \
|
THIRD_PARTY_LIBCXXABI_TEST_DIRECTDEPS = \
|
||||||
LIBC_NEXGEN32E \
|
LIBC_NEXGEN32E \
|
||||||
|
LIBC_LOG \
|
||||||
THIRD_PARTY_LIBCXX \
|
THIRD_PARTY_LIBCXX \
|
||||||
THIRD_PARTY_LIBCXXABI
|
THIRD_PARTY_LIBCXXABI
|
||||||
|
|
||||||
|
@ -168,8 +167,6 @@ o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.com.dbg: \
|
||||||
$(APE_NO_MODIFY_SELF)
|
$(APE_NO_MODIFY_SELF)
|
||||||
@$(APELINK)
|
@$(APELINK)
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
o/$(MODE)/third_party/libcxxabi/test/catch_multi_level_pointer.pass.o: private COPTS += -O0
|
o/$(MODE)/third_party/libcxxabi/test/catch_multi_level_pointer.pass.o: private COPTS += -O0
|
||||||
o/$(MODE)/third_party/libcxxabi/test/catch_multi_level_pointer.pass.o: private QUOTA += -C30 -M4000m
|
o/$(MODE)/third_party/libcxxabi/test/catch_multi_level_pointer.pass.o: private QUOTA += -C30 -M4000m
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue