summaryrefslogtreecommitdiffstats
path: root/Kbuild
diff options
context:
space:
mode:
authorMasahiro Yamada2017-11-13 11:29:37 +0100
committerMasahiro Yamada2017-11-16 01:07:35 +0100
commit8a78756eb545a6fb8007fa154a626ca2bc208027 (patch)
treea5f6f791cf742128df2d9af0cfba1393cae0b0c4 /Kbuild
parentkbuild: filter-out PHONY targets from "targets" (diff)
downloadkernel-qcow2-linux-8a78756eb545a6fb8007fa154a626ca2bc208027.tar.gz
kernel-qcow2-linux-8a78756eb545a6fb8007fa154a626ca2bc208027.tar.xz
kernel-qcow2-linux-8a78756eb545a6fb8007fa154a626ca2bc208027.zip
kbuild: create object directories simpler and faster
For the out-of-tree build, scripts/Makefile.build creates output directories, but this operation is not efficient. scripts/Makefile.lib calculates obj-dirs as follows: obj-dirs := $(dir $(multi-objs) $(obj-y)) Please notice $(sort ...) is not used here. Usually the result is as many "./" as objects here. For a lot of duplicated paths, the following command is invoked. _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d))) Then, the costly shell command is run over and over again. I see many points for optimization: [1] Use $(sort ...) to cut down duplicated paths before passing them to system call [2] Use single $(shell ...) instead of repeating it with $(foreach ...) This will reduce forking. [3] We can calculate obj-dirs more simply. Most of objects are already accumulated in $(targets). So, $(dir $(targets)) is fine and more comprehensive. I also removed ugly code in arch/x86/entry/vdso/Makefile. This is now really unnecessary. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Ingo Molnar <mingo@kernel.org> Tested-by: Douglas Anderson <dianders@chromium.org>
Diffstat (limited to 'Kbuild')
0 files changed, 0 insertions, 0 deletions