42 lines · plain
1# SPDX-License-Identifier: GPL-2.02# Copyright (C) 2020 ARM Limited3 4CFLAGS += -std=gnu99 -I. -pthread5LDFLAGS += -pthread6SRCS := $(filter-out mte_common_util.c,$(wildcard *.c))7PROGS := $(patsubst %.c,%,$(SRCS))8 9ifeq ($(LLVM),)10# For GCC check that the toolchain has MTE support.11 12# preserve CC value from top level Makefile13ifeq ($(CC),cc)14CC := $(CROSS_COMPILE)gcc15endif16 17#check if the compiler works well18mte_cc_support := $(shell if ($(CC) $(CFLAGS) -march=armv8.5-a+memtag -E -x c /dev/null -o /dev/null 2>&1) then echo "1"; fi)19 20else21 22# All supported clang versions also support MTE.23mte_cc_support := 124 25endif26 27ifeq ($(mte_cc_support),1)28# Generated binaries to be installed by top KSFT script29TEST_GEN_PROGS := $(PROGS)30 31else32 $(warning compiler "$(CC)" does not support the ARMv8.5 MTE extension.)33 $(warning test program "mte" will not be created.)34endif35 36# Include KSFT lib.mk.37include ../../lib.mk38 39ifeq ($(mte_cc_support),1)40$(TEST_GEN_PROGS): mte_common_util.c mte_helper.S41endif42