Skip to content

Commit 41c2400

Browse files
theyoyojoakpm00
authored andcommitted
selftests: vm: Makefile: rename TARGETS to VMTARGETS
The tools/testing/selftests/vm/Makefile uses the variable TARGETS internally to generate a list of platform-specific binary build targets suffixed with _{32,64}. When building the selftests using its own Makefile directly, such as via the following command run in a kernel tree: One receives an error such as the following: make: Entering directory '/root/linux/tools/testing/selftests' make --no-builtin-rules ARCH=x86 -C ../../.. headers_install make[1]: Entering directory '/root/linux' INSTALL ./usr/include make[1]: Leaving directory '/root/linux' make[1]: Entering directory '/root/linux/tools/testing/selftests/vm' make[1]: *** No rule to make target 'vm.c', needed by '/root/linux/tools/testing/selftests/vm/vm_64'. Stop. make[1]: Leaving directory '/root/linux/tools/testing/selftests/vm' make: *** [Makefile:175: all] Error 2 make: Leaving directory '/root/linux/tools/testing/selftests' The TARGETS variable passed to tools/testing/selftests/Makefile collides with the TARGETS used in tools/testing/selftests/vm/Makefile, so rename the latter to VMTARGETS, eliminating the collision with no functional change. Link: https://lkml.kernel.org/r/[email protected] Fixes: f21fda8 ("selftests: vm: pkeys: fix multilib builds for x86") Signed-off-by: Joel Savitz <[email protected]> Acked-by: Nico Pache <[email protected]> Cc: Joel Savitz <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Sandipan Das <[email protected]> Cc: Dave Hansen <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2839b09 commit 41c2400

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/testing/selftests/vm/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_32bit_prog
5757
CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_64bit_program.c)
5858
CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_program.c -no-pie)
5959

60-
TARGETS := protection_keys
61-
BINARIES_32 := $(TARGETS:%=%_32)
62-
BINARIES_64 := $(TARGETS:%=%_64)
60+
VMTARGETS := protection_keys
61+
BINARIES_32 := $(VMTARGETS:%=%_32)
62+
BINARIES_64 := $(VMTARGETS:%=%_64)
6363

6464
ifeq ($(CAN_BUILD_WITH_NOPIE),1)
6565
CFLAGS += -no-pie
@@ -112,15 +112,15 @@ $(BINARIES_32): CFLAGS += -m32 -mxsave
112112
$(BINARIES_32): LDLIBS += -lrt -ldl -lm
113113
$(BINARIES_32): $(OUTPUT)/%_32: %.c
114114
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
115-
$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-32,$(t))))
115+
$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-32,$(t))))
116116
endif
117117

118118
ifeq ($(CAN_BUILD_X86_64),1)
119119
$(BINARIES_64): CFLAGS += -m64 -mxsave
120120
$(BINARIES_64): LDLIBS += -lrt -ldl
121121
$(BINARIES_64): $(OUTPUT)/%_64: %.c
122122
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
123-
$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-64,$(t))))
123+
$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-64,$(t))))
124124
endif
125125

126126
# x86_64 users should be encouraged to install 32-bit libraries

0 commit comments

Comments
 (0)