]> git-server-git.apps.pok.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)
committerKefu Chai <tchaikov@gmail.com>
Wed, 31 Aug 2022 12:36:53 +0000 (20:36 +0800)
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>
(cherry picked from commit 381507a31c4740bfc75dff8f13026df89e0ccdf8)

ceph.spec.in

index 531a5991f9471c9cf728c0cf97ff4f5eaaf0972e..ee5bd55e0234ff09fd931d08e9d947ac733ae948 100644 (file)
@@ -1208,9 +1208,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