From 381507a31c4740bfc75dff8f13026df89e0ccdf8 Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Tue, 3 Aug 2021 10:11:58 +0200 Subject: [PATCH] rpm: Re-enable LTO on supported systems We can now use LTO when building ceph. The symver issue was fixed by using the gcc __symver__ attribute. The systems that support it can now re-enable LTO. Fixes: https://tracker.ceph.com/issues/40060 Signed-off-by: Boris Ranto --- ceph.spec.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index 4d4082394d469..b5e7435344a62 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -1235,9 +1235,11 @@ This package provides Ceph default alerts for Prometheus. %autosetup -p1 -n @TARBALL_BASENAME@ %build -# LTO can be enabled as soon as the following GCC bug is fixed: -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200 +# Disable lto on systems that do not support symver attribute +# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200 for details +%if ( 0%{?rhel} && 0%{?rhel} < 9 ) || ( 0%{?suse_version} && 0%{?suse_version} <= 1500 ) %define _lto_cflags %{nil} +%endif %if 0%{with seastar} && 0%{?rhel} . /opt/rh/gcc-toolset-9/enable -- 2.39.5