ulib: Allow undefined symbols in the library

At present it isn't possible for ulib to call a function outside the
library, since it produces a link error.

Relax this contraint, so we can call a main() function provided by the
main program.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2025-11-05 20:29:15 +01:00
parent 9b84b5c623
commit 561c939a82

View File

@@ -1057,6 +1057,12 @@ endif
LDFLAGS_u-boot += $(LDFLAGS_FINAL)
# When building as a library, allow undefined symbols (e.g., main)
# which will be resolved when linking the final static binary
ifdef CONFIG_ULIB
LDFLAGS_u-boot += --unresolved-symbols=ignore-all
endif
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker)