ANDROID: kbuild: lto: permit the use of .a archives in LTO modules

Permit the use of AR archives in .a format as input to the partial link
that produces a kernel module. This permits a set of builtin objects to
be bundled with a module object, to create a single module carrying the
payload of several modules. This is used by the FIPS 140 module.

Bug: 153614920
Bug: 188620248
Change-Id: I7183e6922a03aed498f947062bf0d36709371294
Signed-off-by: Ard Biesheuvel <ardb@google.com>
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 3f6bf0e..a4b0505 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -439,7 +439,7 @@
 cmd_link_multi-m =						\
 	$(cmd_update_lto_symversions);				\
 	rm -f $@; 						\
-	$(AR) cDPrsT $@ $(filter %.o,$^)
+	$(AR) cDPrsT $@ $(filter %.o %.a,$^)
 else
 quiet_cmd_link_multi-m = LD [M]  $@
       cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^)