From 3b958eb6785acd9efab71328e8b1a27bc5921c22 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Mon, 16 Jan 2023 10:40:14 +0800 Subject: [PATCH] add loongarch support for ceph --- ...ludes-when-compiling-with-boost-1.75.patch | 29 +++++++++++++++++++ 0013-add-atomic-library-for-loongarch64.patch | 25 ++++++++++++++++ ceph.spec | 19 ++++++++++-- 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 0012-add-missing-includes-when-compiling-with-boost-1.75.patch create mode 100644 0013-add-atomic-library-for-loongarch64.patch diff --git a/0012-add-missing-includes-when-compiling-with-boost-1.75.patch b/0012-add-missing-includes-when-compiling-with-boost-1.75.patch new file mode 100644 index 0000000..05a9da9 --- /dev/null +++ b/0012-add-missing-includes-when-compiling-with-boost-1.75.patch @@ -0,0 +1,29 @@ +From 46d99c8020dae9372328399618246cd9bc7b4e2b Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Thu, 12 Jan 2023 09:03:33 +0800 +Subject: [PATCH] rgw_string.h: has missing includes when compiling with +boost 1.78 + +ceph compilation failure: invalid use of incomplete type in rgw +https://tracker.ceph.com/issues/50952 +https://tracker.ceph.com/issues/50924 +--- + src/rgw/rgw_string.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/rgw/rgw_string.h b/src/rgw/rgw_string.h +index 257daa9c1..90e64f98a 100644 +--- a/src/rgw/rgw_string.h ++++ b/src/rgw/rgw_string.h +@@ -8,6 +8,8 @@ + #include + #include + #include ++#include ++#include + + #include + +-- +2.33.0 + diff --git a/0013-add-atomic-library-for-loongarch64.patch b/0013-add-atomic-library-for-loongarch64.patch new file mode 100644 index 0000000..ec0e925 --- /dev/null +++ b/0013-add-atomic-library-for-loongarch64.patch @@ -0,0 +1,25 @@ +From 4f6828fc2b7d29557e80ebce6a31a7aa0a1b3e17 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Thu, 12 Jan 2023 16:17:54 +0800 +Subject: [PATCH] add atomic library for loongarch64 + +--- + cmake/modules/CheckCxxAtomic.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/modules/CheckCxxAtomic.cmake b/cmake/modules/CheckCxxAtomic.cmake +index 0b06d5ee4..a2a2a3bfa 100644 +--- a/cmake/modules/CheckCxxAtomic.cmake ++++ b/cmake/modules/CheckCxxAtomic.cmake +@@ -11,7 +11,7 @@ function(check_cxx_atomics var) + #include + #include + +-#if defined(__s390x__) || defined(__sw_64__) ++#if defined(__s390x__) || defined(__sw_64__) || defined(__loongarch64) + // Boost needs 16-byte atomics for tagged pointers. + // These are implemented via inline instructions on the platform + // if 16-byte alignment can be proven, and are delegated to libatomic +-- +2.33.0 + diff --git a/ceph.spec b/ceph.spec index 9b56652..30943e9 100644 --- a/ceph.spec +++ b/ceph.spec @@ -125,7 +125,7 @@ ################################################################################# Name: ceph Version: 16.2.7 -Release: 13 +Release: 14 %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} Epoch: 2 %endif @@ -154,6 +154,8 @@ Patch8: 0008-enable-sw64-architecture.patch Patch9: 0009-fix-CVE-2022-0670.patch Patch10: 0010-fix-CVE-2022-3650.patch Patch11: 0011-fix-no-module-named-v1_event-for-mgr-k8sevent.patch +Patch12: 0012-add-missing-includes-when-compiling-with-boost-1.75.patch +Patch13: 0013-add-atomic-library-for-loongarch64.patch %if 0%{?suse_version} # _insert_obs_source_lines_here ExclusiveArch: x86_64 aarch64 ppc64le s390x @@ -404,6 +406,11 @@ BuildRequires: libnuma-devel %if 0%{?rhel} >= 8 || 0%{?openEuler} BuildRequires: /usr/bin/pathfix.py %endif +%ifarch loongarch64 +BuildRequires: boost-devel +BuildRequires: boost-random +BuildRequires: libatomic +%endif %description Ceph is a massively scalable, open-source, distributed storage system that runs @@ -1207,7 +1214,9 @@ This package provides Ceph default alerts for Prometheus. ################################################################################# %prep %autosetup -p1 -n ceph-16.2.7 -%ifnarch sw_64 + +%ifnarch loongarch64 sw_64 +%patch13 -R -p1 %patch8 -R -p1 %endif @@ -1343,6 +1352,9 @@ ${CMAKE} .. \ -DBOOST_J=$CEPH_SMP_NCPUS \ %if 0%{?rhel} -DWITH_FMT_HEADER_ONLY:BOOL=ON \ +%endif +%ifarch loongarch64 + -DWITH_SYSTEM_BOOST=ON \ %endif -DWITH_GRAFANA=ON @@ -2489,6 +2501,9 @@ exit 0 %config %{_sysconfdir}/prometheus/ceph/ceph_default_alerts.yml %changelog +* Thu Jan 12 2023 Wenlong Zhang - 2:16.2.7-14 +- add loongarch support for ceph + * Wed Dec 28 2022 yaoguangzhong - 2:16.2.7-13 - fix no module named v1_event for mgr/k8sevent