Make considerably more progress on AARCH64

- Utilities like pledge.com now build
- kprintf() will no longer balk at 48-bit addresses
- There's a new aarch64-dbg build mode that should work
- gc() and defer() are mostly pacified; avoid using them on aarch64
- THIRD_PART_STB now has Arm Neon intrinsics for fast image handling
This commit is contained in:
Justine Tunney 2023-05-12 22:42:57 -07:00
parent 1bfb3aab1b
commit fd34ef732d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
91 changed files with 1288 additions and 1192 deletions

View file

@ -1,2 +0,0 @@
#include "libc/sysv/macros.internal.h"
.scall sys_access,0x0210210212021015,0xfff,globl,hidden

View file

@ -360,6 +360,7 @@
#define __NR_linux_stat 0x004f
#define __NR_linux_fstat 0x0050
#define __NR_linux_ppoll 0x0049
#define __NR_linux_brk 0x00d6
#define __NR_linux_sigreturn 0x008b
#define __NR_linux_lseek 0x003e
#define __NR_linux_mmap 0x00de

View file

@ -33,6 +33,7 @@ __errfun:
str w19,[x0]
mov x0,#-1
ldp x19,x30,[sp],#16
ret
#else
#error "unsupported architecture"
#endif

View file

@ -18,11 +18,6 @@
*/
#include "libc/errno.h"
asm(".weak\t__asan_init");
asm(".weak\t__asan_register_globals");
asm(".weak\t__asan_unregister_globals");
asm(".weak\t__asan_version_mismatch_check_v8");
/**
* Global variable for last error.
*

View file

@ -56,7 +56,6 @@ scall sys_pread 0x8ad8ad9db2899811 0x043 globl hidden # a.k.a. pread64; netbsd+
scall sys_pwrite 0x8ae8ae9dc289a812 0x044 globl hidden # a.k.a. pwrite64; netbsd+openbsd:pad
scall sys_readv 0x8788788782878813 0x041 globl hidden
scall sys_writev 0x8798798792879814 0x042 globl hidden
scall sys_access 0x0210210212021015 0xfff globl hidden
scall __sys_pipe 0x02a10721e202a016 0x03b globl hidden # NOTE: pipe2() on FreeBSD and Linux Aarch64; XNU is pipe(void)→eax:edx
scall sys_select 0x9a184785d285d817 0xfff globl hidden
scall sys_pselect 0x9b486ea0a298a90e 0x048 globl hidden # pselect6() on gnu/systemd

View file

@ -24,6 +24,7 @@
// for the purpose of counting non-Windows system calls. Please
// note wrappers may still short circuit calls sometimes, which
// wouldn't impact this counter.
.bss
.balign 8
__syscount:
@ -31,6 +32,8 @@ __syscount:
.endobj __syscount,globl
.previous
#ifdef __x86_64__
.initbss 701,_init___syscount
__syscount_next:
.quad 0
@ -49,3 +52,5 @@ syscount:
ezlea syscount,ax
mov %rax,__systemfive(%rip)
.init.end 701,_init___syscount
#endif /* __x86_64__ */

View file

@ -70,6 +70,11 @@ $(LIBC_SYSV_A).pkg: \
$(LIBC_SYSV_A_OBJS) \
$(foreach x,$(LIBC_SYSV_A_DIRECTDEPS),$($(x)_A).pkg)
o/$(MODE)/libc/sysv/errno.o \
o/$(MODE)/libc/sysv/sysret.o: private \
OVERRIDE_CFLAGS += \
$(NO_MAGIC)
#───────────────────────────────────────────────────────────────────────────────
LIBC_SYSV_CALLS = \
@ -129,6 +134,8 @@ $(LIBC_SYSV_MACHCALLS_A).pkg: \
# let aarch64 compile these
o/$(MODE)/libc/sysv/errfun.o: libc/sysv/errfun.S
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $<
o/$(MODE)/libc/sysv/syscount.o: libc/sysv/syscount.S
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $<
o/$(MODE)/libc/sysv/restorert.o: libc/sysv/restorert.S
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $<
o/$(MODE)/libc/sysv/calls/%.o: libc/sysv/calls/%.S