Get TEST_LIBC_STR passing on AARCH64

It's now possible to run commands like:

    make -j8 m=aarch64 o/aarch64/test/libc/str

Which will cross-compile and run the test suites in a qemu-aarch64
binary that's vendored in the third_party/qemu/ folder within your
x86_64 build environment.
This commit is contained in:
Justine Tunney 2023-05-12 18:09:23 -07:00
parent 45186c74ac
commit 414667b1c9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
24 changed files with 657 additions and 61 deletions

View file

@ -33,11 +33,11 @@
// @param rax,rdx,xmm0,xmm1,st0,st1 is return value
// @see test/libc/runtime/gc_test.c
// @threadsafe
__gc: mov %fs:0,%rcx # __get_tls()
mov 0x18(%rcx),%rcx # tls::garbages
decl (%rcx) # ++g->i
mov (%rcx),%r8d # r8 = g->i
mov 8(%rcx),%r9 # r9 = g->p
__gc: mov %fs:0,%rcx // __get_tls()
mov 0x18(%rcx),%rcx // tls::garbages
decl (%rcx) // ++g->i
mov (%rcx),%r8d // r8 = g->i
mov 8(%rcx),%r9 // r9 = g->p
js 9f
shl $5,%r8
lea (%r9,%r8),%r8

View file

@ -18,6 +18,8 @@
*/
#include "libc/macros.internal.h"
#ifdef __x86_64__
.initbss 202,_init_kHalfCache3
// Half size of level 3 cache in bytes.
kHalfCache3:
@ -60,3 +62,14 @@ kHalfCache3:
4: shr %eax
stosq
.init.end 202,_init_kHalfCache3
#else
.rodata
.align 8
kHalfCache3:
.quad 4 * 1024 * 1024
.endobj kHalfCache3,globl
.previous
#endif /* __x86_64__ */

View file

@ -68,6 +68,8 @@ o/$(MODE)/libc/nexgen32e/setjmp.o: libc/nexgen32e/setjmp.S
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
o/$(MODE)/libc/nexgen32e/missingno.o: libc/nexgen32e/missingno.S
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
o/$(MODE)/libc/nexgen32e/khalfcache3.o: libc/nexgen32e/khalfcache3.S
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
LIBC_NEXGEN32E_LIBS = $(foreach x,$(LIBC_NEXGEN32E_ARTIFACTS),$($(x)))
LIBC_NEXGEN32E_SRCS = $(foreach x,$(LIBC_NEXGEN32E_ARTIFACTS),$($(x)_SRCS))