From a5a4de201bf0f747ba438c6f1d45fb4bd2c4dfbc Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 10 Jan 2022 10:10:36 +0100 Subject: [PATCH] package/musl: disable LTO unconditionally Recent commit b7a00b39bca0 (package/glibc: force -fno-lto) only catered for glibc, but all C libraries, like musl, are impacted, for very similar reasons. Disable LTO unconditionally for musl too. Signed-off-by: Yann E. MORIN Cc: Norbert Lange Signed-off-by: Thomas Petazzoni --- package/musl/musl.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/musl/musl.mk b/package/musl/musl.mk index d4f26b50a7..b89945e3be 100644 --- a/package/musl/musl.mk +++ b/package/musl/musl.mk @@ -26,6 +26,12 @@ MUSL_ADD_TOOLCHAIN_DEPENDENCY = NO MUSL_INSTALL_STAGING = YES +# musl does not build with LTO, so explicitly disable it +# when using a compiler that may have support for LTO +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7),y) +MUSL_EXTRA_CFLAGS += -fno-lto +endif + # Thumb build is broken, build in ARM mode, since all architectures # that support Thumb1 also support ARM. ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)