[openwrt/openwrt] busybox: fix LTO compiler flags

LEDE Commits lede-commits at lists.infradead.org
Sat Dec 28 13:50:10 PST 2024


nbd pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/9a0a05d52abf1f16037baf39004ce1307042f1e0

commit 9a0a05d52abf1f16037baf39004ce1307042f1e0
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Dec 28 22:46:19 2024 +0100

    busybox: fix LTO compiler flags
    
    When doing LTO builds, the target related CFLAGS need to be passed to the
    linker, so that they are considered for target code generation.
    Pass TARGET_CFLAGS in EXTRA_LDFLAGS to ensure that this is handled properly.
    
    Fixes: #17200
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry picked from commit e6ce868c3a6f843f2c14498d0174011c8713a8bd)
---
 package/utils/busybox/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 4ef470df75..7d302bd159 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -111,7 +111,7 @@ endif
 MAKE_VARS :=
 MAKE_FLAGS += \
 	EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
-	EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
+	EXTRA_LDFLAGS="$(TARGET_LDFLAGS) $(TARGET_CFLAGS)" \
 	LDLIBS="$(LDLIBS)" \
 	LD="$(TARGET_CC)" \
 	SKIP_STRIP=y




More information about the lede-commits mailing list