Skip to content

Commit 7ea1355

Browse files
committed
selftests: kallsyms: fix double build stupidity
The current arrangement will have the test modules rebuilt on any make without having the script or code actually change. Take Masahiro Yamada's suggested fix and cleanups on the Makefile to fix this. Suggested-by: Masahiro Yamada <[email protected]> Reported-by: Linus Torvalds <[email protected]> Fixes: 84b4a51 ("selftests: add new kallsyms selftests") Closes: https://lore.kernel.org/all/CAK7LNATRDODmfz1tE=inV-DQqPA4G9vKH+38zMbaGdpTuFWZFw@mail.gmail.com/T/#me6c8f98e82acbee6e75a31b34bbb543eb4940b15 Signed-off-by: Luis Chamberlain <[email protected]>
1 parent b86545e commit 7ea1355

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/tests/module/Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ obj-$(CONFIG_TEST_KALLSYMS_B) += test_kallsyms_b.o
33
obj-$(CONFIG_TEST_KALLSYMS_C) += test_kallsyms_c.o
44
obj-$(CONFIG_TEST_KALLSYMS_D) += test_kallsyms_d.o
55

6-
$(obj)/%.c: FORCE
7-
@$(kecho) " GEN $@"
8-
$(Q)$(srctree)/lib/tests/module/gen_test_kallsyms.sh $@\
9-
$(CONFIG_TEST_KALLSYMS_NUMSYMS) \
10-
$(CONFIG_TEST_KALLSYMS_SCALE_FACTOR)
6+
quiet_cmd_gen_test_kallsyms = GEN $@
7+
cmd_gen_test_kallsyms = $< $@ \
8+
$(CONFIG_TEST_KALLSYMS_NUMSYMS) \
9+
$(CONFIG_TEST_KALLSYMS_SCALE_FACTOR)
1110

12-
clean-files += test_kallsyms_a.c
13-
clean-files += test_kallsyms_b.c
14-
clean-files += test_kallsyms_c.c
15-
clean-files += test_kallsyms_d.c
11+
$(obj)/%.c: $(src)/gen_test_kallsyms.sh FORCE
12+
$(call if_changed,gen_test_kallsyms)
13+
14+
targets += $(foreach x, a b c d, test_kallsyms_$(x).c)

0 commit comments

Comments
 (0)