Skip to content

Commit 69ea912

Browse files
committed
kbuild: remove unneeded link_multi_deps
Since commit c8589d1 ("kbuild: handle multi-objs dependency appropriately"), $^ really represents all the prerequisite of the composite object being built. Hence, $(filter %.o,$^) contains all the objects to link together, which is much simpler than link_multi_deps calculation. Please note $(filter-out FORCE,$^) does not work here. When a single object module is turned into a multi object module, $^ will contain header files that were previously included for building the single object, and recorded in the .*.cmd file. To filter out such headers, $(filter %.o,$^) should be used here. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 9df3e7a commit 69ea912

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

‎scripts/Makefile.build‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -485,28 +485,12 @@ targets += $(obj)/lib-ksyms.o
485485

486486
endif
487487

488-
#
489-
# Rule to link composite objects
490-
#
491-
# Composite objects are specified in kbuild makefile as follows:
492-
# <composite-object>-objs := <list of .o files>
493-
# or
494-
# <composite-object>-y := <list of .o files>
495-
# or
496-
# <composite-object>-m := <list of .o files>
497-
# The -m syntax only works if <composite object> is a module
498-
link_multi_deps = \
499-
$(filter $(addprefix $(obj)/, \
500-
$($(subst $(obj)/,,$(@:.o=-objs))) \
501-
$($(subst $(obj)/,,$(@:.o=-y))) \
502-
$($(subst $(obj)/,,$(@:.o=-m)))), $^)
503-
504488
quiet_cmd_link_multi-m = LD [M] $@
505-
cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
489+
cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis)
506490

507491
$(multi-used-m): FORCE
508492
$(call if_changed,link_multi-m)
509-
@{ echo $(@:.o=.ko); echo $(link_multi_deps); \
493+
@{ echo $(@:.o=.ko); echo $(filter %.o,$^); \
510494
$(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod)
511495
$(call multi_depend, $(multi-used-m), .o, -objs -y -m)
512496

0 commit comments

Comments
 (0)