From 998f333177a5b47c8c59e3fa1903b0a6cabc08f0 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Fri, 26 Jul 2019 12:47:52 +0800 Subject: [PATCH] ANDROID: kbuild: avoid excessively long argument lists With LTO, modules with a large number of compilation units maybe end up exceeding the for loop argument list in the shell. Reduce the probability for this happening by including only the modules that have exported symbols. Bug: 150234396 Change-Id: I4a289aff47e1444aca28d1bd00b125628f39bcd5 Suggested-by: Hsiu-Chang Chen Signed-off-by: Sami Tolvanen --- scripts/Makefile.build | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 585ea170818f..e510a1f5d20e 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -462,13 +462,12 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ; ifdef CONFIG_LTO_CLANG ifdef CONFIG_MODVERSIONS # combine symversions for later processing - update_lto_symversions = \ - rm -f $@.symversions; \ - for i in $(filter-out FORCE,$^); do \ - if [ -f $$i.symversions ]; then \ - cat $$i.symversions \ - >> $@.symversions; \ - fi; \ + update_lto_symversions = \ + rm -f $@.symversions; \ + for i in $(foreach n, \ + $(filter-out FORCE,$^), \ + $(if $(wildcard $(n).symversions),$(n))); do \ + cat $$i.symversions >> $@.symversions; \ done; endif # rebuild the symbol table with llvm-ar to include IR files