History

kbuild: make *.mod not depend on *.o

The dependency $(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o ... exists because *.mod files previously contained undefined symbols, which are computed from *.o files when CONFIG_TRIM_UNUSED_KSYMS=y. Now that the undefined symbols are put into separate *.usyms files, there is no reason to make *.mod depend on *.o files.

Masahiro Yamada committed 4 years ago

Commit fc93a4c1 parent 22f26f22 files · +4 −4Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/Makefile.build+2−3
@@ -85,7 +85,7 @@ ifdef need-builtin · 84 unmodified lines
8585 targets-for-builtin += $(obj)/built-in.a
8686 endif
8787
88−targets-for-modules := $(foreach x, mod $(if $(CONFIG_TRIM_UNUSED_KSYMS), usyms), \
88+targets-for-modules := $(foreach x, o mod $(if $(CONFIG_TRIM_UNUSED_KSYMS), usyms), \
8989 $(patsubst %.o, %.$x, $(filter %.o, $(obj-m))))
9090
9191 ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),)
@@ -306,7 +306,7 @@ endif · 214 unmodified lines
306306 cmd_mod = echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)) | \
307307 $(AWK) -v RS='( |\n)' '!x[$$0]++' > $@
308308
309−$(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o FORCE
309+$(obj)/%.mod: FORCE
310310 $(call if_changed,mod)
311311
312312 # List module undefined symbols
@@ -469,7 +469,6 @@ $(multi-obj-m): FORCE · 156 unmodified lines
469469 $(call if_changed,link_multi-m)
470470 $(call multi_depend, $(multi-obj-m), .o, -objs -y -m)
471471
472−targets += $(multi-obj-m)
473472 targets := $(filter-out $(PHONY), $(targets))
474473
475474 # Add intermediate targets: