提交 fc93a4cd 编写于 作者: M Masahiro Yamada

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.
Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
上级 22f26f21
...@@ -1792,7 +1792,8 @@ ifdef single-build ...@@ -1792,7 +1792,8 @@ ifdef single-build
# .ko is special because modpost is needed # .ko is special because modpost is needed
single-ko := $(sort $(filter %.ko, $(MAKECMDGOALS))) single-ko := $(sort $(filter %.ko, $(MAKECMDGOALS)))
single-no-ko := $(sort $(patsubst %.ko,%.mod, $(MAKECMDGOALS))) single-no-ko := $(filter-out $(single-ko), $(MAKECMDGOALS)) \
$(foreach x, o mod, $(patsubst %.ko, %.$x, $(single-ko)))
$(single-ko): single_modpost $(single-ko): single_modpost
@: @:
......
...@@ -85,7 +85,7 @@ ifdef need-builtin ...@@ -85,7 +85,7 @@ ifdef need-builtin
targets-for-builtin += $(obj)/built-in.a targets-for-builtin += $(obj)/built-in.a
endif endif
targets-for-modules := $(foreach x, mod $(if $(CONFIG_TRIM_UNUSED_KSYMS), usyms), \ targets-for-modules := $(foreach x, o mod $(if $(CONFIG_TRIM_UNUSED_KSYMS), usyms), \
$(patsubst %.o, %.$x, $(filter %.o, $(obj-m)))) $(patsubst %.o, %.$x, $(filter %.o, $(obj-m))))
ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),) ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),)
...@@ -306,7 +306,7 @@ endif ...@@ -306,7 +306,7 @@ endif
cmd_mod = echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)) | \ cmd_mod = echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)) | \
$(AWK) -v RS='( |\n)' '!x[$$0]++' > $@ $(AWK) -v RS='( |\n)' '!x[$$0]++' > $@
$(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o FORCE $(obj)/%.mod: FORCE
$(call if_changed,mod) $(call if_changed,mod)
# List module undefined symbols # List module undefined symbols
...@@ -469,7 +469,6 @@ $(multi-obj-m): FORCE ...@@ -469,7 +469,6 @@ $(multi-obj-m): FORCE
$(call if_changed,link_multi-m) $(call if_changed,link_multi-m)
$(call multi_depend, $(multi-obj-m), .o, -objs -y -m) $(call multi_depend, $(multi-obj-m), .o, -objs -y -m)
targets += $(multi-obj-m)
targets := $(filter-out $(PHONY), $(targets)) targets := $(filter-out $(PHONY), $(targets))
# Add intermediate targets: # Add intermediate targets:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册