Browse Source

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 <nolange79@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Norbert Lange 4 years ago
parent
commit
b7a00b39bc
1 changed files with 5 additions and 0 deletions
  1. 5 0
      package/glibc/glibc.mk

+ 5 - 0
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