From 3e4c90bbf43db5d042caf90c44853e359cb603cb Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 11 Sep 2019 16:02:10 +0100 Subject: [PATCH] Problem: package build fails on SUSE Tumbleweed Solution: add -ffat-lto-objects if the compiler supports it --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/configure.ac b/configure.ac index 9511bd72..2abf0a33 100644 --- a/configure.ac +++ b/configure.ac @@ -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)