linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: simplify cmd_mod
@ 2021-01-13  1:18 Jeff Johnson
  2021-01-13  1:18 ` [PATCH 2/2] kbuild: handle excessively long argument lists Jeff Johnson
  2021-01-15  1:07 ` [PATCH 1/2] kbuild: simplify cmd_mod Nick Desaulniers
  0 siblings, 2 replies; 12+ messages in thread
From: Jeff Johnson @ 2021-01-13  1:18 UTC (permalink / raw)
  To: linux-kbuild
  Cc: psodagud, eberman, Mahesh Kumar Kalikot Veetil, Jeff Johnson,
	Masahiro Yamada, Michal Marek, linux-kernel

From: Mahesh Kumar Kalikot Veetil <mkalikot@codeaurora.org>

Modules with a large number of compilation units can exceed execv
argument list resulting in E2BIG (Argument list too long) error.

Fix this by replacing shell 'echo > file' into a more native
$(file op filename[,text]) option.

Signed-off-by: Mahesh Kumar Kalikot Veetil <mkalikot@codeaurora.org>
Signed-off-by: Jeff Johnson <jjohnson@codeaurora.org>
---
 scripts/Makefile.build | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 4c058f1..252b7d2 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -279,10 +279,11 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
 	$(call if_changed_rule,cc_o_c)
 	$(call cmd,force_checksrc)
 
-cmd_mod = { \
-	echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \
-	$(undefined_syms) echo; \
-	} > $@
+cmd_mod = $(file >$@,\
+		$(if $($*-objs)$($*-y)$($*-m), \
+			$(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), \
+			$(@:.mod=.o))) \
+	$(undefined_syms) echo >> $@
 
 $(obj)/%.mod: $(obj)/%.o FORCE
 	$(call if_changed,mod)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-01-19 20:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  1:18 [PATCH 1/2] kbuild: simplify cmd_mod Jeff Johnson
2021-01-13  1:18 ` [PATCH 2/2] kbuild: handle excessively long argument lists Jeff Johnson
2021-01-14 21:07   ` Nick Desaulniers
2021-01-14 21:32     ` jjohnson
2021-01-14 21:49   ` [PATCH v2 " Jeff Johnson
2021-01-15  1:00     ` Nick Desaulniers
2021-01-15  1:25       ` Masahiro Yamada
2021-01-15  1:12     ` Masahiro Yamada
2021-01-15 20:15       ` jjohnson
2021-01-15 21:53         ` Masahiro Yamada
2021-01-19 20:02           ` mkalikot
2021-01-15  1:07 ` [PATCH 1/2] kbuild: simplify cmd_mod Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).