xref: /kvm-unit-tests/arm/Makefile.arm64 (revision 846737f068d95d5d4652a8bc17332cdfd1e8d74b)
1#
2# arm64 makefile
3#
4# Authors: Andrew Jones <drjones@redhat.com>
5#
6bits = 64
7ldarch = elf64-littleaarch64
8
9arch_LDFLAGS = -pie -n
10arch_LDFLAGS += -z notext
11CFLAGS += -mstrict-align
12
13sve_flag := $(call cc-option, -march=armv8.5-a+sve, "")
14ifneq ($(strip $(sve_flag)),)
15# Don't pass the option to the compiler, we don't
16# want the compiler to generate SVE instructions.
17CFLAGS += -DCC_HAS_SVE
18endif
19
20mno_outline_atomics := $(call cc-option, -mno-outline-atomics, "")
21CFLAGS += $(mno_outline_atomics)
22CFLAGS += -DCONFIG_RELOC
23CFLAGS += -mgeneral-regs-only
24
25define arch_elf_check =
26	$(if $(shell ! $(READELF) -rW $(1) >&/dev/null && echo "nok"),
27		$(error $(shell $(READELF) -rW $(1) 2>&1)))
28	$(if $(shell $(READELF) -rW $(1) | grep R_ | grep -v R_AARCH64_RELATIVE),
29		$(error $(1) has unsupported reloc types))
30endef
31
32cstart.o = $(TEST_DIR)/cstart64.o
33cflatobjs += lib/arm64/stack.o
34cflatobjs += lib/arm64/processor.o
35cflatobjs += lib/arm64/spinlock.o
36cflatobjs += lib/arm64/gic-v3-its.o lib/arm64/gic-v3-its-cmd.o
37
38ifeq ($(CONFIG_EFI),y)
39cflatobjs += lib/acpi.o
40endif
41
42OBJDIRS += lib/arm64
43
44ifeq ($(CONFIG_EFI),y)
45# avoid jump tables before all relocations have been processed
46arm/efi/reloc_aarch64.o: CFLAGS += -fno-jump-tables
47cflatobjs += arm/efi/reloc_aarch64.o
48
49exe = efi
50else
51exe = flat
52endif
53
54# arm64 specific tests
55tests = $(TEST_DIR)/timer.$(exe)
56tests += $(TEST_DIR)/micro-bench.$(exe)
57tests += $(TEST_DIR)/cache.$(exe)
58tests += $(TEST_DIR)/debug.$(exe)
59tests += $(TEST_DIR)/fpu.$(exe)
60
61include $(SRCDIR)/$(TEST_DIR)/Makefile.common
62
63arch_clean: arm_clean
64	$(RM) lib/arm64/.*.d
65