From 85414490f5556d6007b8c7825bf5edd5b1cce8b2 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 Git-commit: 1245167 Git-repo: https://android.googlesource.com/kernel/common Signed-off-by: Prakruthi Deepak Heragu --- scripts/Makefile.build | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 88bfd4b51378..42066d24b13e 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -412,13 +412,12 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ; # combine symversions for later processing quiet_cmd_update_lto_symversions = SYMVER $@ ifeq ($(CONFIG_LTO_CLANG) $(CONFIG_MODVERSIONS),y y) - cmd_update_lto_symversions = \ - rm -f $@.symversions; \ - for i in $(filter-out FORCE,$^); do \ - if [ -f $$i.symversions ]; then \ - cat $$i.symversions \ - >> $@.symversions; \ - fi; \ + cmd_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 else cmd_update_lto_symversions = echo >/dev/null