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 <[email protected]>
Signed-off-by: Sami Tolvanen <[email protected]>
This commit is contained in:
Sami Tolvanen 2019-07-26 12:47:52 +08:00 • committed by Alistair Delva
commit a105629b82

View file

@ -407,13 +407,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 [email protected]; \
for i in $(filter-out FORCE,$^); do \
if [ -f $$i.symversions ]; then \
cat $$i.symversions \
>> [email protected]; \
fi; \
cmd_update_lto_symversions = \
rm -f [email protected]; \
for i in $(foreach n, \
$(filter-out FORCE,$^), \
$(if $(wildcard $(n).symversions),$(n))); do \
cat $$i.symversions >> [email protected]; \
done
else
cmd_update_lto_symversions = echo >/dev/null