]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kbuild: generate Module.symvers only when vmlinux exists
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 25 Mar 2021 18:54:09 +0000 (03:54 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Thu, 1 Apr 2021 16:28:04 +0000 (01:28 +0900)
commit1c21ac0990084da45747d5c1922c46c6d0469c4d
treed3f29eb4a12db432954a82a46a1b3b324e82f88b
parent04c535d5b0deb19cdb4c3284ff5e74957c0cd531
kbuild: generate Module.symvers only when vmlinux exists

The external module build shows the following warning if Module.symvers
is missing in the kernel tree.

  WARNING: Symbol version dump "Module.symvers" is missing.
           Modules may not have dependencies or modversions.

I think this is an important heads-up because the resulting modules may
not work as expected. This happens when you did not build the entire
kernel tree, for example, you might have prepared the minimal setups
for external modules by 'make defconfig && make modules_preapre'.

A problem is that 'make modules' creates Module.symvers even without
vmlinux. In this case, that warning is suppressed since Module.symvers
already exists in spite of its incomplete content.

The incomplete (i.e. invalid) Module.symvers should not be created.

This commit changes the second pass of modpost to dump symbols into
modules-only.symvers. The final Module.symvers is created by
concatenating vmlinux.symvers and modules-only.symvers if both exist.

Module.symvers is supposed to collect symbols from both vmlinux and
modules. It might be a bit confusing, and I am not quite sure if it
is an official interface, but presumably it is difficult to rename it
because some tools (e.g. kmod) parse it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
.gitignore
Documentation/dontdiff
Makefile
scripts/Makefile.modpost
scripts/mod/modpost.c