Skip to content

Commit

Permalink
Merge pull request #55886 from tchaikov/wip-ceph.spec-gcc-13
Browse files Browse the repository at this point in the history
ceph.spec.in: bump gcc-toolset to 13 and use it on rhel>=8

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
  • Loading branch information
athanatos committed Mar 21, 2024
2 parents 6f35d34 + 913d127 commit dbfb661
Showing 1 changed file with 49 additions and 16 deletions.
65 changes: 49 additions & 16 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,26 @@
%{!?python3_pkgversion: %global python3_pkgversion 3}
%{!?python3_version_nodots: %global python3_version_nodots 3}
%{!?python3_version: %global python3_version 3}
%{!?gts_prefix: %global gts_prefix gcc-toolset-11}
%if 0%{with seastar}
%{!?gts_version: %global gts_version 13}
%else
%if 0%{?rhel} == 8
%{!?gts_version: %global gts_version 11}
%endif
%endif

# gcc-toolset-13 seems to trigger a linker bug resulting in a segfault in SafeTimer
# and perhaps elsewhere. For now, let's just disable it. See
# ceph bug https://tracker.ceph.com/issues/63867
# and
# gcc bug https://bugzilla.redhat.com/show_bug.cgi?id=2241339
# for details.
#
# Also 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%{?gts_version} == 13 || (0%{?rhel} && 0%{?rhel} < 9) || ( 0%{?suse_version} && 0%{?suse_version} <= 1500 )
%define _lto_cflags %{nil}
%endif

%if ! 0%{?suse_version}
# use multi-threaded xz compression: xz level 7 using ncpus threads
Expand Down Expand Up @@ -173,9 +192,17 @@
# do not provide gcc-annobin.so anymore, despite that they provide annobin.so. but
# redhat-rpm-config still passes -fplugin=gcc-annobin to the compiler.
%undefine _annotated_build
%if 0%{?rhel} == 8 && 0%{?enable_devtoolset11:1}
%if 0%{?gts_version} > 0
%if 0%{gts_version} == 13
%if 0%{?enable_devtoolset13:1}
%enable_devtoolset13
%endif
%else
%if 0%{?enable_devtoolset11:1}
%enable_devtoolset11
%endif
%endif
%endif

#################################################################################
# main package definition
Expand Down Expand Up @@ -229,10 +256,14 @@ BuildRequires: gcc-c++ >= 11
%if 0%{?suse_version} == 1500
BuildRequires: gcc11-c++
%endif
%if 0%{?rhel} == 8
BuildRequires: %{gts_prefix}-gcc-c++
BuildRequires: %{gts_prefix}-build
BuildRequires: %{gts_prefix}-libatomic-devel
%if 0%{?gts_version} > 0
BuildRequires: gcc-toolset-%{gts_version}-gcc-c++
%if 0%{?gts_version} >= 12
BuildRequires: gcc-toolset-%{gts_version}-runtime
%else
BuildRequires: gcc-toolset-%{gts_version}-build
%endif
BuildRequires: gcc-toolset-%{gts_version}-libatomic-devel
%endif
%if 0%{?fedora} || 0%{?rhel} == 9 || 0%{?openEuler}
BuildRequires: libatomic
Expand Down Expand Up @@ -358,11 +389,15 @@ BuildRequires: libubsan
BuildRequires: libasan
BuildRequires: protobuf-devel
BuildRequires: protobuf-compiler
%if 0%{?rhel} == 8
BuildRequires: %{gts_prefix}-annobin
BuildRequires: %{gts_prefix}-annobin-plugin-gcc
BuildRequires: %{gts_prefix}-libubsan-devel
BuildRequires: %{gts_prefix}-libasan-devel
%if 0%{?gts_version} > 0
%if 0%{?gts_version} >= 12
BuildRequires: gcc-toolset-%{gts_version}-gcc-plugin-annobin
%else
BuildRequires: gcc-toolset-%{gts_version}-annobin
BuildRequires: gcc-toolset-%{gts_version}-annobin-plugin-gcc
%endif
BuildRequires: gcc-toolset-%{gts_version}-libubsan-devel
BuildRequires: gcc-toolset-%{gts_version}-libasan-devel
%endif
%endif
#################################################################################
Expand Down Expand Up @@ -1337,11 +1372,6 @@ This package provides a Ceph hardware monitoring agent.
%autosetup -p1 -n @TARBALL_BASENAME@

%build
# 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 cephfs_java}
# Find jni.h
Expand Down Expand Up @@ -1378,6 +1408,9 @@ cmake .. \
%if 0%{?suse_version} == 1500
-DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-11 \
%endif
%if 0%{?gts_version} == 13
-DCMAKE_EXE_LINKER_FLAGS=-lstdc++ \
%endif
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
Expand Down

0 comments on commit dbfb661

Please sign in to comment.