* [PATCH] kbuild: remove sed command from cmd_ar_builtin
@ 2022-06-14 4:11 Masahiro Yamada
0 siblings, 0 replies; only message in thread
From: Masahiro Yamada @ 2022-06-14 4:11 UTC (permalink / raw)
To: linux-kbuild
Cc: Masahiro Yamada, Michal Marek, Nick Desaulniers, linux-kernel
Replace a pipeline of echo and sed with printf to decrease process forks.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/Makefile.build | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index cac070aee791..d69849133dad 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -358,9 +358,8 @@ $(subdir-modorder): $(obj)/%/modules.order: $(obj)/% ;
quiet_cmd_ar_builtin = AR $@
cmd_ar_builtin = rm -f $@; \
- echo $(patsubst $(obj)/%,%,$(real-prereqs)) | \
- sed -E 's:([^ ]+):$(obj)/\1:g' | \
- xargs $(AR) cDPrST $@
+ $(if $(real-prereqs), printf "$(obj)/%s " $(patsubst $(obj)/%,%,$(real-prereqs)), :) | \
+ xargs $(AR) cDPrST $@
$(obj)/built-in.a: $(real-obj-y) FORCE
$(call if_changed,ar_builtin)
--
2.32.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-14 4:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-14 4:11 [PATCH] kbuild: remove sed command from cmd_ar_builtin Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox