Re: [PATCH 4/4] selftests: Add build infrastructure along with README

From: Dev Jain
Date: Thu Apr 11 2024 - 01:15:53 EST



On 4/7/24 02:45, Muhammad Usama Anjum wrote:
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 15b6a111c3be..8478d94cda4c 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
TARGETS += alsa
TARGETS += amd-pstate
+TARGETS += arm
TARGETS += arm64
TARGETS += bpf
TARGETS += breakpoints
diff --git a/tools/testing/selftests/arm/Makefile b/tools/testing/selftests/arm/Makefile
new file mode 100644
index 000000000000..039224bc006e
--- /dev/null
+++ b/tools/testing/selftests/arm/Makefile
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: GPL-2.0
+
+# When ARCH not overridden for crosscompiling, lookup machine
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+
+ifneq (,$(filter $(ARCH),aarch64 arm64 arm armv7l armv8l))
+ARM_SUBTARGETS ?= mm signal elf
+else
+ARM_SUBTARGETS :=
+endif
+
+CFLAGS := -Wall -O2 -g -static
+
+# A proper top_srcdir is needed by KSFT(lib.mk)
+top_srcdir = $(realpath ../../../../)
+
+# Additional include paths needed by kselftest.h and local headers
+CFLAGS += -I$(top_srcdir)/tools/testing/selftests/
+
+CFLAGS += -I$(top_srcdir)/tools/include
Please use KHDR_INCLUDE instead of using absolute path


The reason I had excluded it was that the signal tests won't

build then. What probably happens is that the kernel headers

collide with the headers included by the compiler.