Debian Codegraph @

tools/testing/selftests/riscv/cfi/Makefile

raw
1 CFLAGS += $(KHDR_INCLUDES)
2 CFLAGS += -I$(top_srcdir)/tools/include
3
4 CFLAGS += -march=rv64gc_zicfilp_zicfiss -fcf-protection=full
5
6 # Check for zicfi* extensions needs cross compiler
7 # which is not set until lib.mk is included
8 ifeq ($(LLVM)$(CC),cc)
9 CC := $(CROSS_COMPILE)gcc
10 endif
11
12
13 ifeq ($(shell $(CC) $(CFLAGS) -nostdlib -xc /dev/null -o /dev/null > /dev/null 2>&1; echo $$?),0)
14 TEST_GEN_PROGS := cfitests
15
16 $(OUTPUT)/cfitests: cfitests.c shadowstack.c
17 $(CC) -o$@ $(CFLAGS) $(LDFLAGS) $^
18 else
19
20 $(shell echo "Toolchain doesn't support CFI, skipping CFI kselftest." >&2)
21 endif
22
23 include ../../lib.mk