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
parent 6f2a9a3536
commit 998f333177

View File

@ -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