mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
kbuild: move modules.builtin(.modinfo) rules to Makefile.vmlinux_o
Do not build modules.builtin(.modinfo) as a side-effect of vmlinux. There are no good reason to rebuild them just because any of vmlinux's prerequistes (vmlinux.lds, .vmlinux.export.c, etc.) has been updated. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
637a642f5c
commit
7a342e6c77
6
Makefile
6
Makefile
@ -1153,9 +1153,13 @@ targets += vmlinux.a
|
||||
vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE
|
||||
$(call if_changed,ar_vmlinux.a)
|
||||
|
||||
vmlinux.o: vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE
|
||||
PHONY += vmlinux_o
|
||||
vmlinux_o: vmlinux.a $(KBUILD_VMLINUX_LIBS)
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.vmlinux_o
|
||||
|
||||
vmlinux.o modules.builtin.modinfo modules.builtin: vmlinux_o
|
||||
@:
|
||||
|
||||
ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
|
||||
|
||||
# Final link of vmlinux with optional arch pass after final link
|
||||
|
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
PHONY := __default
|
||||
__default: vmlinux.o
|
||||
__default: vmlinux.o modules.builtin.modinfo modules.builtin
|
||||
|
||||
include include/config/auto.conf
|
||||
include $(srctree)/scripts/Kbuild.include
|
||||
@ -62,6 +62,30 @@ vmlinux.o: $(initcalls-lds) vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE
|
||||
|
||||
targets += vmlinux.o
|
||||
|
||||
# module.builtin.modinfo
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary
|
||||
|
||||
targets += modules.builtin.modinfo
|
||||
modules.builtin.modinfo: vmlinux.o FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
# module.builtin
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# The second line aids cases where multiple modules share the same object.
|
||||
|
||||
quiet_cmd_modules_builtin = GEN $@
|
||||
cmd_modules_builtin = \
|
||||
tr '\0' '\n' < $< | \
|
||||
sed -n 's/^[[:alnum:]:_]*\.file=//p' | \
|
||||
tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$$/.ko/' > $@
|
||||
|
||||
targets += modules.builtin
|
||||
modules.builtin: modules.builtin.modinfo FORCE
|
||||
$(call if_changed,modules_builtin)
|
||||
|
||||
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
@ -214,13 +214,6 @@ if [ "$1" = "clean" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
info MODINFO modules.builtin.modinfo
|
||||
${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo
|
||||
info GEN modules.builtin
|
||||
# The second line aids cases where multiple modules share the same object.
|
||||
tr '\0' '\n' < modules.builtin.modinfo | sed -n 's/^[[:alnum:]:_]*\.file=//p' |
|
||||
tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$/.ko/' > modules.builtin
|
||||
|
||||
if is_enabled CONFIG_MODULES; then
|
||||
${MAKE} -f "${srctree}/scripts/Makefile.vmlinux" .vmlinux.export.o
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user