From b7a00b39bca0df9737890145b7f59b9c1c3d2e4c Mon Sep 17 00:00:00 2001 From: Norbert Lange Date: Sun, 18 Oct 2020 00:17:43 +0200 Subject: [PATCH] package/glibc: force -fno-lto glibc requires compilation barriers between files, and will fail with LTO enabled. So force LTO off by appending -fno-lto to the flags, but only if the GCC version is recent enough that an LTO build would be possible. Signed-off-by: Norbert Lange Signed-off-by: Yann E. MORIN --- package/glibc/glibc.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk index 3862e0624b..5c26b0e6df 100644 --- a/package/glibc/glibc.mk +++ b/package/glibc/glibc.mk @@ -53,6 +53,11 @@ ifeq ($(BR2_ENABLE_DEBUG),y) GLIBC_EXTRA_CFLAGS += -g endif +# glibc explicitly requires compile barriers between files +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7),y) +GLIBC_EXTRA_CFLAGS += -fno-lto +endif + # The stubs.h header is not installed by install-headers, but is # needed for the gcc build. An empty stubs.h will work, as explained # in http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html. The same trick