diff mbox series

busybox: Pass linker flags via HOSTCC

Message ID 20260403023840.1192106-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series busybox: Pass linker flags via HOSTCC | expand

Commit Message

Khem Raj April 3, 2026, 2:38 a.m. UTC
From: Khem Raj <raj.khem@gmail.com>

HOSTCC is used for linking as well but does not use any flags that
we can manipulate to add only during link step, we do depend on
what runtime to link to when using clang for host compiler which is
controlled via BUILD_LDFLAGS, therefore add that option to hostcc

This helps building busybox with TOOLCHAIN_NATIVE is set to clang

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/busybox/busybox.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 355c019738..c7b76a3dd8 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -21,7 +21,7 @@  CFLAGS:append:toolchain-clang = " -DBB_GLOBAL_CONST=''"
 export EXTRA_CFLAGS = "${CFLAGS}"
 export EXTRA_LDFLAGS = "${LDFLAGS}"
 
-EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' HOSTCPP='${BUILD_CPP}'"
+EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC} ${BUILD_LDFLAGS} ' HOSTCPP='${BUILD_CPP}'"
 
 PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"