Problem: package build fails on SUSE Tumbleweed

Solution: add -ffat-lto-objects if the compiler supports it
This commit is contained in:
Luca Boccassi 2019-09-11 16:02:10 +01:00
parent 79535f39ca
commit 3e4c90bbf4

View File

@ -949,6 +949,20 @@ AX_CHECK_COMPILE_FLAG([-Wno-tautological-constant-compare],
[],
[-Werror])
# LTO is enabled by default on SUSE Tumbleweed and RPM lint generates an error if
# the flag is not used to compile archives:
# E: lto-no-text-in-archive
AC_LANG_PUSH([C])
AX_CHECK_COMPILE_FLAG([-ffat-lto-objects],
[CFLAGS+=" -ffat-lto-objects"],
[],
[-Werror])
AC_LANG_POP([C])
AX_CHECK_COMPILE_FLAG([-ffat-lto-objects],
[CXXFLAGS+=" -ffat-lto-objects"],
[],
[-Werror])
# Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS
AC_SUBST(LIBZMQ_EXTRA_CFLAGS)
AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS)