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 <hsiuchangchen@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
Sami Tolvanen 2019-07-26 12:47:52 +08:00 committed by Alistair Delva
parent fd734b5e29
commit 7871c485de

View File

@ -400,13 +400,12 @@ $(obj)/%/built-in.a: $(obj)/% ;
# 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