Skip to content

Commit dbfb661

Browse files
authored
Merge pull request ceph#55886 from tchaikov/wip-ceph.spec-gcc-13
ceph.spec.in: bump gcc-toolset to 13 and use it on rhel>=8 Reviewed-by: Samuel Just <[email protected]> Reviewed-by: Radoslaw Zarzynski <[email protected]>
2 parents 6f35d34 + 913d127 commit dbfb661

File tree

1 file changed

+49
-16
lines changed

1 file changed

+49
-16
lines changed

ceph.spec.in

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,26 @@
141141
%{!?python3_pkgversion: %global python3_pkgversion 3}
142142
%{!?python3_version_nodots: %global python3_version_nodots 3}
143143
%{!?python3_version: %global python3_version 3}
144-
%{!?gts_prefix: %global gts_prefix gcc-toolset-11}
144+
%if 0%{with seastar}
145+
%{!?gts_version: %global gts_version 13}
146+
%else
147+
%if 0%{?rhel} == 8
148+
%{!?gts_version: %global gts_version 11}
149+
%endif
150+
%endif
151+
152+
# gcc-toolset-13 seems to trigger a linker bug resulting in a segfault in SafeTimer
153+
# and perhaps elsewhere. For now, let's just disable it. See
154+
# ceph bug https://tracker.ceph.com/issues/63867
155+
# and
156+
# gcc bug https://bugzilla.redhat.com/show_bug.cgi?id=2241339
157+
# for details.
158+
#
159+
# Also disable lto on systems that do not support symver attribute
160+
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200 for details
161+
%if 0%{?gts_version} == 13 || (0%{?rhel} && 0%{?rhel} < 9) || ( 0%{?suse_version} && 0%{?suse_version} <= 1500 )
162+
%define _lto_cflags %{nil}
163+
%endif
145164

146165
%if ! 0%{?suse_version}
147166
# use multi-threaded xz compression: xz level 7 using ncpus threads
@@ -173,9 +192,17 @@
173192
# do not provide gcc-annobin.so anymore, despite that they provide annobin.so. but
174193
# redhat-rpm-config still passes -fplugin=gcc-annobin to the compiler.
175194
%undefine _annotated_build
176-
%if 0%{?rhel} == 8 && 0%{?enable_devtoolset11:1}
195+
%if 0%{?gts_version} > 0
196+
%if 0%{gts_version} == 13
197+
%if 0%{?enable_devtoolset13:1}
198+
%enable_devtoolset13
199+
%endif
200+
%else
201+
%if 0%{?enable_devtoolset11:1}
177202
%enable_devtoolset11
178203
%endif
204+
%endif
205+
%endif
179206

180207
#################################################################################
181208
# main package definition
@@ -229,10 +256,14 @@ BuildRequires: gcc-c++ >= 11
229256
%if 0%{?suse_version} == 1500
230257
BuildRequires: gcc11-c++
231258
%endif
232-
%if 0%{?rhel} == 8
233-
BuildRequires: %{gts_prefix}-gcc-c++
234-
BuildRequires: %{gts_prefix}-build
235-
BuildRequires: %{gts_prefix}-libatomic-devel
259+
%if 0%{?gts_version} > 0
260+
BuildRequires: gcc-toolset-%{gts_version}-gcc-c++
261+
%if 0%{?gts_version} >= 12
262+
BuildRequires: gcc-toolset-%{gts_version}-runtime
263+
%else
264+
BuildRequires: gcc-toolset-%{gts_version}-build
265+
%endif
266+
BuildRequires: gcc-toolset-%{gts_version}-libatomic-devel
236267
%endif
237268
%if 0%{?fedora} || 0%{?rhel} == 9 || 0%{?openEuler}
238269
BuildRequires: libatomic
@@ -358,11 +389,15 @@ BuildRequires: libubsan
358389
BuildRequires: libasan
359390
BuildRequires: protobuf-devel
360391
BuildRequires: protobuf-compiler
361-
%if 0%{?rhel} == 8
362-
BuildRequires: %{gts_prefix}-annobin
363-
BuildRequires: %{gts_prefix}-annobin-plugin-gcc
364-
BuildRequires: %{gts_prefix}-libubsan-devel
365-
BuildRequires: %{gts_prefix}-libasan-devel
392+
%if 0%{?gts_version} > 0
393+
%if 0%{?gts_version} >= 12
394+
BuildRequires: gcc-toolset-%{gts_version}-gcc-plugin-annobin
395+
%else
396+
BuildRequires: gcc-toolset-%{gts_version}-annobin
397+
BuildRequires: gcc-toolset-%{gts_version}-annobin-plugin-gcc
398+
%endif
399+
BuildRequires: gcc-toolset-%{gts_version}-libubsan-devel
400+
BuildRequires: gcc-toolset-%{gts_version}-libasan-devel
366401
%endif
367402
%endif
368403
#################################################################################
@@ -1337,11 +1372,6 @@ This package provides a Ceph hardware monitoring agent.
13371372
%autosetup -p1 -n @TARBALL_BASENAME@
13381373

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

13461376
%if 0%{with cephfs_java}
13471377
# Find jni.h
@@ -1378,6 +1408,9 @@ cmake .. \
13781408
%if 0%{?suse_version} == 1500
13791409
-DCMAKE_C_COMPILER=gcc-11 \
13801410
-DCMAKE_CXX_COMPILER=g++-11 \
1411+
%endif
1412+
%if 0%{?gts_version} == 13
1413+
-DCMAKE_EXE_LINKER_FLAGS=-lstdc++ \
13811414
%endif
13821415
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
13831416
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \

0 commit comments

Comments
 (0)