Weak symbols don't work as expected when you try to override them from within the same static library. Static libraries are just archives of individual objects, and when the linker tries to resolve a symbol against it it simply uses the implementation from the first object that has one, weak or not. It does not search through all remaining objects to see if there's also a strong implementation. We've had multiple cases in libpayload where builds were incorrectly using the default implementation rather than an optimized arch-specific implementation for years due to this issue. To prevent it from recurring, this patch adds some postprocessing script to the Makefile that checks for this situation and makes the build fail if it creeps in again. Change-Id: I9fcbc9b873901d126322b12954c349c08300369f Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87777 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> |
||
|---|---|---|
| .. | ||
| coreinfo | ||
| external | ||
| libpayload | ||
| linuxcheck | ||
| nvramcui | ||
| Kconfig | ||
| Makefile.mk | ||