Makefile.target (3471B)
1 # -*- Mode: makefile -*- 2 # 3 # Multiarch Tests - included from tests/tcg/Makefile.target 4 # 5 # These tests are plain C and built without any architecture specific code. 6 # 7 8 MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch 9 10 # Set search path for all sources 11 VPATH += $(MULTIARCH_SRC) 12 MULTIARCH_SRCS = $(notdir $(wildcard $(MULTIARCH_SRC)/*.c)) 13 ifeq ($(filter %-linux-user, $(TARGET)),$(TARGET)) 14 VPATH += $(MULTIARCH_SRC)/linux 15 MULTIARCH_SRCS += $(notdir $(wildcard $(MULTIARCH_SRC)/linux/*.c)) 16 endif 17 MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=) 18 19 # 20 # The following are any additional rules needed to build things 21 # 22 23 24 float_%: LDFLAGS+=-lm 25 float_%: float_%.c libs/float_helpers.c 26 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/libs/float_helpers.c -o $@ $(LDFLAGS) 27 28 run-float_%: float_% 29 $(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<) 30 $(call conditional-diff-out,$<,$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/$<.ref) 31 32 33 testthread: LDFLAGS+=-lpthread 34 35 threadcount: LDFLAGS+=-lpthread 36 37 signals: LDFLAGS+=-lrt -lpthread 38 39 munmap-pthread: CFLAGS+=-pthread 40 munmap-pthread: LDFLAGS+=-pthread 41 42 # We define the runner for test-mmap after the individual 43 # architectures have defined their supported pages sizes. If no 44 # additional page sizes are defined we only run the default test. 45 46 # default case (host page size) 47 run-test-mmap: test-mmap 48 $(call run-test, test-mmap, $(QEMU) $<, $< (default)) 49 50 # additional page sizes (defined by each architecture adding to EXTRA_RUNS) 51 run-test-mmap-%: test-mmap 52 $(call run-test, test-mmap-$*, $(QEMU) -p $* $<, $< ($* byte pages)) 53 54 ifneq ($(HAVE_GDB_BIN),) 55 GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py 56 57 run-gdbstub-sha1: sha1 58 $(call run-test, $@, $(GDB_SCRIPT) \ 59 --gdb $(HAVE_GDB_BIN) \ 60 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ 61 --bin $< --test $(MULTIARCH_SRC)/gdbstub/sha1.py, \ 62 basic gdbstub support) 63 64 run-gdbstub-qxfer-auxv-read: sha1 65 $(call run-test, $@, $(GDB_SCRIPT) \ 66 --gdb $(HAVE_GDB_BIN) \ 67 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ 68 --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-qxfer-auxv-read.py, \ 69 basic gdbstub qXfer:auxv:read support) 70 71 run-gdbstub-thread-breakpoint: testthread 72 $(call run-test, $@, $(GDB_SCRIPT) \ 73 --gdb $(HAVE_GDB_BIN) \ 74 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ 75 --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-thread-breakpoint.py, \ 76 hitting a breakpoint on non-main thread) 77 78 else 79 run-gdbstub-%: 80 $(call skip-test, "gdbstub test $*", "need working gdb") 81 endif 82 EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \ 83 run-gdbstub-thread-breakpoint 84 85 # ARM Compatible Semi Hosting Tests 86 # 87 # Despite having ARM in the name we actually have several 88 # architectures that implement it. We gate the tests on the feature 89 # appearing in config. 90 # 91 ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y) 92 VPATH += $(MULTIARCH_SRC)/arm-compat-semi 93 94 # Add -I path back to TARGET_NAME for semicall.h 95 semihosting: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) 96 97 run-semihosting: semihosting 98 $(call run-test,$<,$(QEMU) $< 2> $<.err) 99 100 run-plugin-semihosting-with-%: 101 $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ 102 -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ 103 $(call strip-plugin,$<) 2> $<.err, \ 104 $< with $*) 105 106 semiconsole: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) 107 108 run-semiconsole: semiconsole 109 $(call skip-test, $<, "MANUAL ONLY") 110 111 run-plugin-semiconsole-with-%: 112 $(call skip-test, $<, "MANUAL ONLY") 113 114 TESTS += semihosting semiconsole 115 endif 116 117 # Update TESTS 118 TESTS += $(MULTIARCH_TESTS)