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

Unified · Split

2 files
  1. Makefile +2 −1
  2. scripts/Makefile.build +2 −3
Makefile+2−1
@@ -1792,7 +1792,8 @@ ifdef single-build · 1791 unmodified lines
1792 1792
1793# .ko is special because modpost is needed1793# .ko is special because modpost is needed
1794single-ko := $(sort $(filter %.ko, $(MAKECMDGOALS)))1794single-ko := $(sort $(filter %.ko, $(MAKECMDGOALS)))
1795single-no-ko := $(sort $(patsubst %.ko,%.mod, $(MAKECMDGOALS)))1795single-no-ko := $(filter-out $(single-ko), $(MAKECMDGOALS)) \
1796 $(foreach x, o mod, $(patsubst %.ko, %.$x, $(single-ko)))
1796 1797
1797$(single-ko): single_modpost1798$(single-ko): single_modpost
1798 @:1799 @:
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: