5 AARCH64_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/aarch64/system
6 VPATH+=$(AARCH64_SYSTEM_SRC)
8 # These objects provide the basic boot code and helper functions for all tests
11 AARCH64_TEST_SRCS=$(wildcard $(AARCH64_SYSTEM_SRC)/*.c)
12 AARCH64_TESTS = $(patsubst $(AARCH64_SYSTEM_SRC)/%.c, %, $(AARCH64_TEST_SRCS))
14 CRT_PATH=$(AARCH64_SYSTEM_SRC)
15 LINK_SCRIPT=$(AARCH64_SYSTEM_SRC)/kernel.ld
16 LDFLAGS=-Wl,-T$(LINK_SCRIPT)
17 TESTS+=$(AARCH64_TESTS) $(MULTIARCH_TESTS)
18 CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
19 LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
22 .PRECIOUS: $(CRT_OBJS)
25 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -c $< -o $@
27 # Build and link the tests
28 %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
29 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
31 memory: CFLAGS+=-DCHECK_UNALIGNED=1
34 QEMU_BASE_MACHINE=-M virt -cpu max -display none
35 QEMU_OPTS+=$(QEMU_BASE_MACHINE) -semihosting-config enable=on,target=native,chardev=output -kernel
37 # console test is manual only
38 QEMU_SEMIHOST=-chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline
39 run-semiconsole: QEMU_OPTS=$(QEMU_BASE_MACHINE) $(QEMU_SEMIHOST) -kernel
40 run-semiconsole: semiconsole
41 $(call skip-test, $<, "MANUAL ONLY")
42 run-plugin-semiconsole-with-%: semiconsole
43 $(call skip-test, $<, "MANUAL ONLY")
45 # Simple Record/Replay Test
47 run-memory-record: memory-record memory
48 $(call run-test, $<, \
49 $(QEMU) -monitor none -display none \
50 -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
51 -icount shift=5$(COMMA)rr=record$(COMMA)rrfile=record.bin \
52 $(QEMU_OPTS) memory, \
53 "$< on $(TARGET_NAME)")
56 run-memory-replay: memory-replay run-memory-record
57 $(call run-test, $<, \
58 $(QEMU) -monitor none -display none \
59 -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
60 -icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \
61 $(QEMU_OPTS) memory, \
62 "$< on $(TARGET_NAME)")
64 EXTRA_RUNS+=run-memory-replay
66 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_3),)
67 pauth-3: CFLAGS += -march=armv8.3-a
70 $(call skip-test, "BUILD of $@", "missing compiler support")
72 $(call skip-test, "RUN of pauth-3", "not built")
73 run-plugin-pauth-3-with-%:
74 $(call skip-test, "RUN of pauth-3 ($*)", "not built")