]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kbuild: remove unneeded link_multi_deps
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 4 Oct 2018 04:25:19 +0000 (13:25 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 19 Oct 2018 00:47:46 +0000 (09:47 +0900)
Since commit c8589d1e9e01 ("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>
scripts/Makefile.build

index cb0377427f944953057cdc1599d4db949b5b7eb9..f21b48d4a8f2cf01f1af56d0e77b1e8b3dd66ac5 100644 (file)
@@ -485,28 +485,12 @@ targets += $(obj)/lib-ksyms.o
 
 endif
 
-#
-# Rule to link composite objects
-#
-#  Composite objects are specified in kbuild makefile as follows:
-#    <composite-object>-objs := <list of .o files>
-#  or
-#    <composite-object>-y    := <list of .o files>
-#  or
-#    <composite-object>-m    := <list of .o files>
-#  The -m syntax only works if <composite object> is a module
-link_multi_deps =                     \
-$(filter $(addprefix $(obj)/,         \
-$($(subst $(obj)/,,$(@:.o=-objs)))    \
-$($(subst $(obj)/,,$(@:.o=-y)))       \
-$($(subst $(obj)/,,$(@:.o=-m)))), $^)
-
 quiet_cmd_link_multi-m = LD [M]  $@
-cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
+cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis)
 
 $(multi-used-m): FORCE
        $(call if_changed,link_multi-m)
-       @{ echo $(@:.o=.ko); echo $(link_multi_deps); \
+       @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \
           $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod)
 $(call multi_depend, $(multi-used-m), .o, -objs -y -m)