payloads/libpayload/Makefile.mk: Replace nm with $(NM)

I got 'nm' usage error when i built coreinfo payload.
	nm: unrecognized option '--no-weak'

it seems that this is occurred by using nm for host, not for coreboot.

So, I replace nm with $(NM)

Change-Id: I0a0a04b351c9131b1238e8cc7e63e396820494d9
Signed-off-by: NyeonWoo Kim <knw0507@naver.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87906
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
NyeonWoo Kim 2025-05-31 18:09:22 +09:00 committed by Matt DeVillier
commit 033810a7db

View file

@ -110,8 +110,8 @@ includes-handler= \
$(obj)/libpayload.a: $(foreach class,$(libraries),$$($(class)-objs))
printf " AR $(subst $(CURDIR)/,,$(@))\n"
printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M
for func in $$(nm $@ | awk '/ (w|W) / { print $$NF }'); do \
if nm --no-weak --defined-only $@ | grep -Eq " $$func$$"; then \
for func in $$($(NM) $@ | awk '/ (w|W) / { print $$NF }'); do \
if $(NM) --no-weak --defined-only $@ | grep -Eq " $$func$$"; then \
printf "\nERROR: Function '$$func' appears as both weak and strong symbol in libpayload.\n"; \
printf " Weak symbol overrides don't work reliably from within the same library.\n\n"; \
rm $@; \