summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/arm64/mte/Makefile
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2023-02-23 11:16:39 +0300
committerIngo Molnar <mingo@kernel.org>2023-02-23 11:16:39 +0300
commit585a78c1f77be305b1f6adad392f16047fb66ffd (patch)
tree765143b487d582832c7695c9fbcae141c35baa4c /tools/testing/selftests/arm64/mte/Makefile
parent37064583f63eca93c98a9cdf2360485ea05f617a (diff)
parent69308402ca6f5b80a5a090ade0b13bd146891420 (diff)
downloadlinux-585a78c1f77be305b1f6adad392f16047fb66ffd.tar.xz
Merge branch 'linus' into objtool/core, to pick up Xen dependencies
Pick up dependencies - freshly merged upstream via xen-next - before applying dependent objtool changes. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/testing/selftests/arm64/mte/Makefile')
-rw-r--r--tools/testing/selftests/arm64/mte/Makefile21
1 files changed, 15 insertions, 6 deletions
diff --git a/tools/testing/selftests/arm64/mte/Makefile b/tools/testing/selftests/arm64/mte/Makefile
index 037046f5784e..0d7ac3db8390 100644
--- a/tools/testing/selftests/arm64/mte/Makefile
+++ b/tools/testing/selftests/arm64/mte/Makefile
@@ -1,24 +1,33 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 ARM Limited
-# preserve CC value from top level Makefile
-ifeq ($(CC),cc)
-CC := $(CROSS_COMPILE)gcc
-endif
-
CFLAGS += -std=gnu99 -I. -pthread
LDFLAGS += -pthread
SRCS := $(filter-out mte_common_util.c,$(wildcard *.c))
PROGS := $(patsubst %.c,%,$(SRCS))
+ifeq ($(LLVM),)
+# For GCC check that the toolchain has MTE support.
+
+# preserve CC value from top level Makefile
+ifeq ($(CC),cc)
+CC := $(CROSS_COMPILE)gcc
+endif
+
#check if the compiler works well
mte_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)
+else
+
+# All supported clang versions also support MTE.
+mte_cc_support := 1
+
+endif
+
ifeq ($(mte_cc_support),1)
# Generated binaries to be installed by top KSFT script
TEST_GEN_PROGS := $(PROGS)
-# Get Kernel headers installed and use them.
else
$(warning compiler "$(CC)" does not support the ARMv8.5 MTE extension.)
$(warning test program "mte" will not be created.)