Skip to contentSkip to conversation

kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y

PATCH New Masahiro Yamada 1 participant 1 message Jan 10, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y

When CONFIG_DEBUG_INFO_BTF_MODULES=y, running 'make modules' in the clean kernel tree will get the following error.

  $ grep CONFIG_DEBUG_INFO_BTF_MODULES .config
  CONFIG_DEBUG_INFO_BTF_MODULES=y
  $ make -s clean
  $ make modules
    [snip]
    AR      vmlinux.a
  ar: ./built-in.a: No such file or directory
  make: *** [Makefile:1241: vmlinux.a] Error 1

'modules' depends on 'vmlinux', but builtin objects are not built.

Define KBUILD_BUILTIN.

Fixes f73edc8951b2 ("kbuild: unify two modpost invocations")

---

 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 760640162db6..2ee3ab599477 100644
@@ -1525,6 +1525,7 @@ endif
 # *.ko are usually independent of vmlinux, but CONFIG_DEBUG_INFOBTF_MODULES
 # is an exception.
 ifdef CONFIG_DEBUG_INFO_BTF_MODULES
+KBUILD_BUILTIN := 1
 modules: vmlinux
 endif
 
Signature · 1 line
2.34.1