]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
u-boot: Ensure we use BFD as linker even if using GCC for it
authorOtavio Salvador <otavio@ossystems.com.br>
Fri, 30 Aug 2024 00:43:24 +0000 (21:43 -0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 1 Sep 2024 07:19:12 +0000 (08:19 +0100)
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.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/u-boot/u-boot.inc

index 5a7bd6703fe31f1c713ec36678b4a5e4bb05b42e..ed3822784ef90d7676f2d9f8cb41c34195f229c4 100644 (file)
@@ -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}'