浏览代码

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 <yann.morin.1998@free.fr>
Cc: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Yann E. MORIN 3 年之前
父节点
当前提交
a5a4de201b
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      package/musl/musl.mk

+ 6 - 0
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)