libpayload/Makefile.inc: Fix ar calls to support llvm-ar

llvm-ar does not support "open" script command, and fails with an error.
This patch fixes it by removing lines `$(AR) rc <object-files>` and
it puts them as "addmod" commands. This way all object files and
archives can be packed into one archive.

Change-Id: I0c53d1d613b5edc321e268d1d996fac3146680f8
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61182
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Jakub Czapiga 2022-01-18 14:22:22 +00:00 committed by Patrick Georgi
parent 8a4a89fdcb
commit 28a97a2ae5
1 changed files with 2 additions and 4 deletions

View File

@ -95,13 +95,11 @@ includes-handler= \
$(obj)/libpayload.a: $(foreach class,$(libraries),$$($(class)-objs))
printf " AR $(subst $(CURDIR)/,,$(@))\n"
$(AR) rc $@ $(filter-out %.a,$^)
printf "open $@\n$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
$(obj)/%.a: $$(%-objs)
printf " AR $(subst $(CURDIR)/,,$(@))\n"
$(AR) rc $@ $(filter-out %.a,$^)
printf "open $@\n$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
$(obj)/head.o: $(obj)/arch/$(ARCHDIR-y)/head.head.o.o
printf " CP $(subst $(CURDIR)/,,$(@))\n"