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.brod...@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: a...@linux-foundation.org Cc: aruna.ramakris...@oracle.com Cc: catalin.mari...@arm.com Cc: dave.han...@linux.intel.com Cc: joey.go...@arm.com Cc: keith.lu...@oracle.com Cc: ryan.robe...@arm.com Cc: sh...@kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kselft...@vger.kernel.org Cc: linux...@kvack.org Cc: x...@kernel.org Cc: linux-s...@vger.kernel.org --- tools/testing/selftests/mm/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 1f0743d9459d..18041de1aebf 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -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 -- 2.47.0