]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: use %enable_devtoolset11 to enable GTS-11
authorKefu Chai <tchaikov@gmail.com>
Mon, 27 Jun 2022 13:18:57 +0000 (21:18 +0800)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 10 Aug 2022 20:02:51 +0000 (16:02 -0400)
%enable_devtoolset11 redefines %___build_pre by appending
`source scl_source enable gcc-toolset-11` to it. `___build_pre` should
be able to populate this setting to both %build and %install. and hence
address the FTBFS where we need to use the tool chain from GTS-11.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit 49459d92fec553246b35719e9defc0ad7582f701)
(cherry picked from commit 89a6a2d80236db0cb2ef54325ebc483c5491da25)

ceph.spec.in

index b42b3ed5c5655a051a33db8a65c544a509097370..2dfc1ad693df3f3bb5bf2f507f46d3dc49075793 100644 (file)
 %endif
 %endif
 
+%if 0%{with seastar}
+# disable -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1, as gcc-toolset-{10,11}-annobin
+# 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%{?enable_devtoolset11:1}
+%enable_devtoolset11
+%endif
+%endif
+
 #################################################################################
 # main package definition
 #################################################################################
@@ -195,6 +205,7 @@ BuildRequires:  cmake > 3.5
 BuildRequires: fuse-devel
 %if 0%{with seastar} && 0%{?rhel}
 BuildRequires: gcc-toolset-11-gcc-c++
+BuildRequires: gcc-toolset-11-build
 %else
 %if 0%{?suse_version}
 BuildRequires: gcc11-c++
@@ -1254,10 +1265,6 @@ This package provides Ceph default alerts for Prometheus.
 %define _lto_cflags %{nil}
 %endif
 
-%if 0%{with seastar} && 0%{?rhel}
-. /opt/rh/gcc-toolset-11/enable
-%endif
-
 %if 0%{with cephfs_java}
 # Find jni.h
 for i in /usr/{lib64,lib}/jvm/java/include{,/linux}; do
@@ -1280,12 +1287,6 @@ export CXXFLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g')
 # remove from CFLAGS too because it causes the arrow submodule to fail with:
 #   warning _FORTIFY_SOURCE requires compiling with optimization (-O)
 export CFLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g')
-%if 0%{?fedora} || 0%{?rhel}
-# disable -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1, as gcc-toolset-{9,10}-annobin
-# 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
-%endif
 %endif
 
 env | sort
@@ -1417,13 +1418,6 @@ popd
 
 %install
 
-%if 0%{with seastar}
-%if 0%{?fedora} || 0%{?rhel}
-%undefine _annotated_build
-. /opt/rh/gcc-toolset-11/enable
-%endif
-%endif
-
 pushd %{_vpath_builddir}
 %make_install
 # we have dropped sysvinit bits