qemu

FORK: QEMU emulator
git clone https://git.neptards.moe/neptards/qemu.git
Log | Files | Refs | Submodules | LICENSE

Makefile.softmmu-target (2523B)


      1 #
      2 # Aarch64 system tests
      3 #
      4 
      5 AARCH64_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/aarch64/system
      6 VPATH+=$(AARCH64_SYSTEM_SRC)
      7 
      8 # These objects provide the basic boot code and helper functions for all tests
      9 CRT_OBJS=boot.o
     10 
     11 AARCH64_TEST_SRCS=$(wildcard $(AARCH64_SYSTEM_SRC)/*.c)
     12 AARCH64_TESTS = $(patsubst $(AARCH64_SYSTEM_SRC)/%.c, %, $(AARCH64_TEST_SRCS))
     13 
     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 EXTRA_RUNS+=$(MULTIARCH_RUNS)
     19 CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
     20 LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
     21 
     22 config-cc.mak: Makefile
     23 	$(quiet-@)( \
     24 	    $(call cc-option,-march=armv8.3-a, CROSS_CC_HAS_ARMV8_3)) 3> config-cc.mak
     25 -include config-cc.mak
     26 
     27 # building head blobs
     28 .PRECIOUS: $(CRT_OBJS)
     29 
     30 %.o: $(CRT_PATH)/%.S
     31 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -c $< -o $@
     32 
     33 # Build and link the tests
     34 %: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
     35 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
     36 
     37 memory: CFLAGS+=-DCHECK_UNALIGNED=1
     38 
     39 # Running
     40 QEMU_BASE_MACHINE=-M virt -cpu max -display none
     41 QEMU_OPTS+=$(QEMU_BASE_MACHINE) -semihosting-config enable=on,target=native,chardev=output -kernel
     42 
     43 # console test is manual only
     44 QEMU_SEMIHOST=-chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline
     45 run-semiconsole: QEMU_OPTS=$(QEMU_BASE_MACHINE) $(QEMU_SEMIHOST)  -kernel
     46 run-semiconsole: semiconsole
     47 	$(call skip-test, $<, "MANUAL ONLY")
     48 run-plugin-semiconsole-with-%: semiconsole
     49 	$(call skip-test, $<, "MANUAL ONLY")
     50 
     51 # Simple Record/Replay Test
     52 .PHONY: memory-record
     53 run-memory-record: memory-record memory
     54 	$(call run-test, $<, \
     55 	  $(QEMU) -monitor none -display none \
     56 		  -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
     57 		  -icount shift=5$(COMMA)rr=record$(COMMA)rrfile=record.bin \
     58 		  $(QEMU_OPTS) memory)
     59 
     60 .PHONY: memory-replay
     61 run-memory-replay: memory-replay run-memory-record
     62 	$(call run-test, $<, \
     63 	  $(QEMU) -monitor none -display none \
     64 		  -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
     65 		  -icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \
     66 		  $(QEMU_OPTS) memory)
     67 
     68 EXTRA_RUNS+=run-memory-replay
     69 
     70 ifneq ($(CROSS_CC_HAS_ARMV8_3),)
     71 pauth-3: CFLAGS += -march=armv8.3-a
     72 else
     73 pauth-3:
     74 	$(call skip-test, "BUILD of $@", "missing compiler support")
     75 run-pauth-3:
     76 	$(call skip-test, "RUN of pauth-3", "not built")
     77 run-plugin-pauth-3-with-%:
     78 	$(call skip-test, "RUN of pauth-3 ($*)", "not built")
     79 endif