kbuild: Let builtin have precedence over modules for kselftest-merge
authorBjörn Töpel <bjorn@rivosinc.com>
Wed, 4 Oct 2023 12:48:36 +0000 (14:48 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 5 Oct 2023 20:23:15 +0000 (14:23 -0600)
The kselftest-merge target walks all kselftests configs, and merges
them. However, builtin does not have precedence over modules. This
breaks some of the tests, e.g.:

$ grep CONFIG_NF_NAT tools/testing/selftests/{bpf,net}/config
tools/testing/selftests/bpf/config:CONFIG_NF_NAT=y
tools/testing/selftests/net/config:CONFIG_NF_NAT=m

Here, the net config will set NF_NAT to module, which makes it clunky
to run the BPF tests.

Add '-y' to scripts/kconfig/merge_config.sh.

Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Makefile

index 57698d048e2caa0d5d9c437cb091156072093015..41fc7681fbab4daf782f3ca06b8eca11c50a28ef 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1368,7 +1368,7 @@ PHONY += kselftest-merge
 kselftest-merge:
        $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
        $(Q)find $(srctree)/tools/testing/selftests -name config | \
-               xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
+               xargs $(srctree)/scripts/kconfig/merge_config.sh -y -m $(objtree)/.config
        $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 
 # ---------------------------------------------------------------------------