]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rpm: Re-enable LTO on supported systems
authorBoris Ranto <branto@redhat.com>
Tue, 3 Aug 2021 08:11:58 +0000 (10:11 +0200)
committerBoris Ranto <branto@redhat.com>
Thu, 5 Aug 2021 13:46:47 +0000 (15:46 +0200)
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 <branto@redhat.com>
ceph.spec.in

index 4d4082394d469d86a123d9a51eccd0d02eb56d1c..b5e7435344a62c8fb661f01e5920eb65e5d9618f 100644 (file)
@@ -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