@@ -147,16 +147,20 @@ TEST_FILES += write_hugetlb_memory.sh
include ../lib.mk
-$(TEST_GEN_PROGS): vm_util.c thp_settings.c pkey_util.c
-$(TEST_GEN_FILES): vm_util.c thp_settings.c pkey_util.c
+$(TEST_GEN_PROGS): vm_util.c thp_settings.c
+$(TEST_GEN_FILES): vm_util.c thp_settings.c
$(OUTPUT)/uffd-stress: uffd-common.c
$(OUTPUT)/uffd-unit-tests: uffd-common.c
+$(OUTPUT)/protection_keys: pkey_util.c
+$(OUTPUT)/pkey_sighandler_tests: pkey_util.c
ifeq ($(ARCH),x86_64)
BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
+$(BINARIES_32) $(BINARIES_64): pkey_util.c
+
define gen-target-rule-32
$(1) $(1)_32: $(OUTPUT)/$(1)_32
.PHONY: $(1) $(1)_32
The pkey* files can only be built on architectures that support pkeys (pkey-helpers.h #error's otherwise). Adding pkey_util.c as dependency to all $(TEST_GEN_FILES) is therefore a bad idea. Make it a dependency of the pkeys tests only. Those tests are built in 32/64-bit variants on x86_64 so we need to add an explicit dependency there as well. Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com> --- Hi Alexander, Thank you for the bug report, that patch indeed breaks all architectures that don't support pkeys, I should have realised that! This patch should fix it. Andrew, it would make sense to squash this patch into the original ("selftests/mm: Use sys_pkey helpers consistently"). Cheers, - Kevin Cc: akpm@linux-foundation.org Cc: aruna.ramakrishna@oracle.com Cc: catalin.marinas@arm.com Cc: dave.hansen@linux.intel.com Cc: joey.gouly@arm.com Cc: keith.lucas@oracle.com Cc: ryan.roberts@arm.com Cc: shuah@kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kselftest@vger.kernel.org Cc: linux-mm@kvack.org Cc: x86@kernel.org Cc: linux-s390@vger.kernel.org --- tools/testing/selftests/mm/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)