diff mbox series

[04/11] u-boot: Ensure we use BFD as linker even if using GCC for it

Message ID 11e70fb42b3ad26b582a17291458a26adc7c7bb6.1748486276.git.tim.orling@konsulko.com
State New
Headers show
Series [01/11] u-boot: Fix potential index error issues in do_deploy with multiple u-boot configurations | expand

Commit Message

Tim Orling May 29, 2025, 2:41 a.m. UTC
From: Otavio Salvador <otavio@ossystems.com.br>

If we are using 'ld-is-gold' as DISTRO_FEATURE, the U-Boot Makefile has
mechanisms to ensure that we use BFD as linker. However, this does not
work for the GCC when it is used as linking tool.

To support that, we added explicit BFD use whenever we have the
DISTRO_FEATURE feature enabled.

(From OE-Core rev: d36ee7a87c0d89b2820eea4bfcdae342adc75019)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 recipes-bsp/u-boot/u-boot.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/recipes-bsp/u-boot/u-boot.inc b/recipes-bsp/u-boot/u-boot.inc
index 6f1170f..9b612e1 100644
--- a/recipes-bsp/u-boot/u-boot.inc
+++ b/recipes-bsp/u-boot/u-boot.inc
@@ -9,7 +9,8 @@  inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kerne
 
 DEPENDS += "swig-native"
 
-EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP}" V=1'
+EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} V=1'
+EXTRA_OEMAKE += 'CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)} ${DEBUG_PREFIX_MAP}"'
 EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
 EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'