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>
[panchajanya1999] : backported to 4.14-android
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
This commit is contained in:
Sami Tolvanen
2019-07-26 16:32:51 +05:30
committed by Pranav Vashi
parent c1f3aa43f1
commit 5f95d691be

View File

@@ -501,13 +501,12 @@ ifdef builtin-target
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