Skip to content

Commit c8f4a15

Browse files
masahir0ygregkh
authored andcommitted
kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt)
commit 53632ba upstream. If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from a pristine state, the vmlinux is linked twice. Commit 3fdc7d3 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") explains why this happens, but it did not fix the issue at all. Now I realized I had applied a wrong patch. In v1 patch [1], the autoksyms_recursive target correctly recurses to "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive". In v2 patch [2], I accidentally dropped the diff line, and it recurses to "$(MAKE) -f $(srctree)/Makefile vmlinux". Restore the code I intended in v1. [1]: https://lore.kernel.org/linux-kbuild/[email protected]/ [2]: https://lore.kernel.org/linux-kbuild/[email protected]/ Fixes: 3fdc7d3 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Sami Tolvanen <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent eb9c7a8 commit c8f4a15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ KBUILD_MODULES := 1
11391139

11401140
autoksyms_recursive: descend modules.order
11411141
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
1142-
"$(MAKE) -f $(srctree)/Makefile vmlinux"
1142+
"$(MAKE) -f $(srctree)/Makefile autoksyms_recursive"
11431143
endif
11441144

11451145
autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)

0 commit comments

Comments
 (0)