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
85targets-for-builtin += $(obj)/built-in.a85targets-for-builtin += $(obj)/built-in.a
86endif86endif
87 87
88targets-for-modules := $(foreach x, mod $(if $(CONFIG_TRIM_UNUSED_KSYMS), usyms), \88targets-for-modules := $(foreach x, o mod $(if $(CONFIG_TRIM_UNUSED_KSYMS), usyms), \
89 $(patsubst %.o, %.$x, $(filter %.o, $(obj-m))))89 $(patsubst %.o, %.$x, $(filter %.o, $(obj-m))))
90 90
91ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),)91ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),)
@@ -306,7 +306,7 @@ endif · 214 unmodified lines
306cmd_mod = echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)) | \306cmd_mod = echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)) | \
307 $(AWK) -v RS='( |\n)' '!x[$$0]++' > $@307 $(AWK) -v RS='( |\n)' '!x[$$0]++' > $@
308 308
309$(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o FORCE309$(obj)/%.mod: FORCE
310 $(call if_changed,mod)310 $(call if_changed,mod)
311 311
312# List module undefined symbols312# List module undefined symbols
@@ -469,7 +469,6 @@ $(multi-obj-m): FORCE · 156 unmodified lines
469 $(call if_changed,link_multi-m)469 $(call if_changed,link_multi-m)
470$(call multi_depend, $(multi-obj-m), .o, -objs -y -m)470$(call multi_depend, $(multi-obj-m), .o, -objs -y -m)
471 471
472targets += $(multi-obj-m)
473targets := $(filter-out $(PHONY), $(targets))472targets := $(filter-out $(PHONY), $(targets))
474 473
475# Add intermediate targets:474# Add intermediate targets: