diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-10-04 00:25:19 -0400 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-10-18 20:47:46 -0400 |
| commit | 69ea912fda74a673d330d23595385e5b73e3a2b9 (patch) | |
| tree | b1e7f945f216baa35fbeebdd6be72a602cd343cb /scripts | |
| parent | 9df3e7a7d7d6d92df7c58fb17f900fdc2d8b5031 (diff) | |
kbuild: remove unneeded link_multi_deps
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>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index cb0377427f94..f21b48d4a8f2 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -485,28 +485,12 @@ targets += $(obj)/lib-ksyms.o | |||
| 485 | 485 | ||
| 486 | endif | 486 | endif |
| 487 | 487 | ||
| 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 | |||
| 504 | quiet_cmd_link_multi-m = LD [M] $@ | 488 | 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) |
| 506 | 490 | ||
| 507 | $(multi-used-m): FORCE | 491 | $(multi-used-m): FORCE |
| 508 | $(call if_changed,link_multi-m) | 492 | $(call if_changed,link_multi-m) |
| 509 | @{ echo $(@:.o=.ko); echo $(link_multi_deps); \ | 493 | @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \ |
| 510 | $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) | 494 | $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) |
| 511 | $(call multi_depend, $(multi-used-m), .o, -objs -y -m) | 495 | $(call multi_depend, $(multi-used-m), .o, -objs -y -m) |
| 512 | 496 | ||
