[PATCH v4 fix] selftests/mm: preserve prerequisite paths in x86

From: Sarthak Sharma

Date: Mon Jun 01 2026 - 01:03:53 EST


Patch 2 adds tools/lib/mm/file_utils.c as a prerequisite using its full
path. The explicit x86 protection_keys build rules still use $(notdir
$^), which strips that path and makes the compiler look for file_utils.c
in tools/testing/selftests/mm/.

Use $^ instead so pathful prerequisites are preserved.

This fixes the patch 2 bisectability issue reported by Sashiko. The same
hunk is already present in patch 3 of v4. If this is folded into patch
2, that duplicate hunk should be dropped from patch 3.

Signed-off-by: Sarthak Sharma <sarthak.sharma@xxxxxxx>
---
tools/testing/selftests/mm/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/mm/Makefile
b/tools/testing/selftests/mm/Makefile
index b5fb4b6ab31b..4254200d1cef 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -217,7 +217,7 @@ $(BINARIES_32): CFLAGS += -m32 -mxsave
$(BINARIES_32): LDLIBS += -lrt -ldl -lm
$(BINARIES_32): $(OUTPUT)/%_32: %.c
$(call msg,CC,,$@)
- $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
+ $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $^ $(LDLIBS) -o $@
$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-32,$(t))))
endif

@@ -226,7 +226,7 @@ $(BINARIES_64): CFLAGS += -m64 -mxsave
$(BINARIES_64): LDLIBS += -lrt -ldl
$(BINARIES_64): $(OUTPUT)/%_64: %.c
$(call msg,CC,,$@)
- $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
+ $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $^ $(LDLIBS) -o $@
$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-64,$(t))))
endif

--
2.39.5