diff mbox series

[v2,4/4] package/glibc: force -fno-lto

Message ID 20201017221743.160029-4-nolange79@gmail.com
State Accepted
Headers show
Series [v2,1/4] package/Makefile.in: use gcc wrappers for binutils tools | expand

Commit Message

Norbert Lange Oct. 17, 2020, 10:17 p.m. UTC
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 <nolange79@gmail.com>
---
 package/glibc/glibc.mk | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk
index 4721177d83..6d07495edc 100644
--- a/package/glibc/glibc.mk
+++ b/package/glibc/glibc.mk
@@ -67,6 +67,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