diff --git a/ceph.spec b/ceph.spec index ce5f180341017d1ef5eddfce8c2a978d315790ae..e51a15720cb4dea61fc9df5565d4e9928e1723f7 100644 --- a/ceph.spec +++ b/ceph.spec @@ -24,6 +24,7 @@ %bcond_with zbd %bcond_with cmake_verbose_logging %bcond_without ceph_test_package +%bcond_with clang %ifarch s390 %bcond_with tcmalloc %else @@ -120,12 +121,16 @@ # disable dwz which compresses the debuginfo %global _find_debuginfo_dwz_opts %{nil} +%if 0%{with clang} +%global toolchain clang +%endif + ################################################################################# # main package definition ################################################################################# Name: ceph Version: 16.2.7 -Release: 15 +Release: 16 %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} Epoch: 2 %endif @@ -183,8 +188,13 @@ BuildRequires: fuse-devel %if 0%{with seastar} BuildRequires: gcc-toolset-9-gcc-c++ >= 9.2.1-2.3 %else +%if 0%{with clang} +BuildRequires: clang +BuildRequires: llvm +%else BuildRequires: gcc-c++ %endif +%endif %if 0%{with tcmalloc} # libprofiler did not build on ppc64le until 2.7.90 %if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?openEuler} @@ -1363,7 +1373,16 @@ cat ./CMakeFiles/CMakeOutput.log cat ./CMakeFiles/CMakeError.log %endif +#add clang+LLVM support +%if %{with clang} +%global make_opts HOSTCC=clang CC=clang CXX=clang++ +%endif +%if %{with clang} +make %{?make_opts} "$CEPH_MFLAGS_JOBS" +%else make "$CEPH_MFLAGS_JOBS" +%endif + %if 0%{with make_check} @@ -2500,6 +2519,9 @@ exit 0 %config %{_sysconfdir}/prometheus/ceph/ceph_default_alerts.yml %changelog +* Wed Mar 8 2023 zhoumeng - 2:16.2.7-16 +- add clang+llvm support for ceph compiling + * Tue Feb 14 2023 wangzengliang - 2:16.2.7-15 - fix error for uninstall cephadm