Skip to content

Commit a164f5f

Browse files
athanatostchaikov
authored andcommitted
ceph.spec.in: disable lto to work around gcc-toolset-13 linker bug
gcc-toolset-13 lto can trigger a linker bug resulting in a segfault in SafeTimer (and perhaps elsewhere). See https://tracker.ceph.com/issues/63867 for details. This patch disables lto for now now so that we can switch to gcc-toolset-13. Fixes: https://tracker.ceph.com/issues/63867 Signed-off-by: Samuel Just <[email protected]>
1 parent f5f2e4c commit a164f5f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ceph.spec.in

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@
143143
%{!?python3_version: %global python3_version 3}
144144
%{!?gts_version: %global gts_version 11}
145145

146+
# gcc-toolset-13 seems to trigger a linker bug resulting in a segfault in SafeTimer
147+
# and perhaps elsewhere. For now, let's just disable it. See
148+
# ceph bug https://tracker.ceph.com/issues/63867
149+
# and
150+
# gcc bug https://bugzilla.redhat.com/show_bug.cgi?id=2241339
151+
# for details.
152+
#
153+
# Also disable lto on systems that do not support symver attribute
154+
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200 for details
155+
%if 0%{?gts_version} == 13 || (0%{?rhel} && 0%{?rhel} < 9) || ( 0%{?suse_version} && 0%{?suse_version} <= 1500 )
156+
%define _lto_cflags %{nil}
157+
%endif
158+
146159
%if ! 0%{?suse_version}
147160
# use multi-threaded xz compression: xz level 7 using ncpus threads
148161
%global _source_payload w7T%{_smp_build_ncpus}.xzdio
@@ -1334,11 +1347,6 @@ This package provides a Ceph hardware monitoring agent.
13341347
%autosetup -p1 -n @TARBALL_BASENAME@
13351348

13361349
%build
1337-
# Disable lto on systems that do not support symver attribute
1338-
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200 for details
1339-
%if ( 0%{?rhel} && 0%{?rhel} < 9 ) || ( 0%{?suse_version} && 0%{?suse_version} <= 1500 )
1340-
%define _lto_cflags %{nil}
1341-
%endif
13421350

13431351
%if 0%{with cephfs_java}
13441352
# Find jni.h

0 commit comments

Comments
 (0)