busybox: fix LTO compiler flags
authorFelix Fietkau <nbd@nbd.name>
Sat, 28 Dec 2024 21:46:19 +0000 (22:46 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sat, 28 Dec 2024 21:48:06 +0000 (22:48 +0100)
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@nbd.name>
package/utils/busybox/Makefile

index cda3be9f2f505d34a9a4e4e165a8d5befc6547b9..7701428570758daedb0c76b728de2fd21db17306 100644 (file)
@@ -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