Gentoo Archives: gentoo-commits

From: "罗百科" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/ceph/files/, sys-cluster/ceph/
Date: Tue, 23 Aug 2022 07:44:40
Message-Id: 1661240674.624ff5962199a2fb0891a96e1afbaac0677d5578.patrick@gentoo
1 commit: 624ff5962199a2fb0891a96e1afbaac0677d5578
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 23 07:44:05 2022 +0000
4 Commit: 罗百科 <patrick <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 23 07:44:34 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=624ff596
7
8 sys-cluster/ceph: More gcc12 fixes
9
10 Patches from
11 https://github.com/lgirdk/meta-virtualization/tree/master/recipes-extended/ceph/ceph
12
13 Package-Manager: Portage-3.0.30, Repoman-3.0.3
14 Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>
15
16 sys-cluster/ceph/ceph-17.2.3-r2.ebuild | 462 +++++++++++++++++++++
17 .../ceph/files/ceph-17.2.0-gcc12-dout.patch | 42 ++
18 .../ceph/files/ceph-17.2.0-gcc12-header.patch | 30 ++
19 3 files changed, 534 insertions(+)
20
21 diff --git a/sys-cluster/ceph/ceph-17.2.3-r2.ebuild b/sys-cluster/ceph/ceph-17.2.3-r2.ebuild
22 new file mode 100644
23 index 000000000000..c31770f38434
24 --- /dev/null
25 +++ b/sys-cluster/ceph/ceph-17.2.3-r2.ebuild
26 @@ -0,0 +1,462 @@
27 +# Copyright 1999-2022 Gentoo Authors
28 +# Distributed under the terms of the GNU General Public License v2
29 +
30 +EAPI=8
31 +
32 +PYTHON_COMPAT=( python3_{8..10} )
33 +LUA_COMPAT=( lua5-{3..4} )
34 +
35 +inherit check-reqs bash-completion-r1 cmake flag-o-matic lua-single \
36 + python-r1 udev readme.gentoo-r1 toolchain-funcs systemd tmpfiles
37 +
38 +SRC_URI="
39 + https://download.ceph.com/tarballs/${P}.tar.gz
40 + parquet? ( https://github.com/xtensor-stack/xsimd/archive/aeec9c872c8b475dedd7781336710f2dd2666cb2.tar.gz -> ceph-xsimd-${PV}.tar.gz )
41 +"
42 +KEYWORDS="~amd64 ~arm64"
43 +
44 +DESCRIPTION="Ceph distributed filesystem"
45 +HOMEPAGE="https://ceph.com/"
46 +
47 +LICENSE="Apache-2.0 LGPL-2.1 CC-BY-SA-3.0 GPL-2 GPL-2+ LGPL-2+ LGPL-2.1 LGPL-3 GPL-3 BSD Boost-1.0 MIT public-domain"
48 +SLOT="0"
49 +
50 +CPU_FLAGS_X86=(avx2 avx512f pclmul sse{,2,3,4_1,4_2} ssse3)
51 +
52 +IUSE="
53 + babeltrace +cephfs custom-cflags diskprediction dpdk fuse grafana
54 + jemalloc jaeger kafka kerberos ldap lttng +mgr +parquet pmdk rabbitmq
55 + +radosgw rbd-rwl rbd-ssd rdma rgw-lua +ssl spdk +sqlite +system-boost
56 + systemd +tcmalloc test +uring xfs zbd zfs
57 +"
58 +
59 +IUSE+="$(printf "cpu_flags_x86_%s\n" ${CPU_FLAGS_X86[@]})"
60 +
61 +DEPEND="
62 + ${LUA_DEPS}
63 + ${PYTHON_DEPS}
64 + acct-group/ceph
65 + acct-user/ceph
66 + virtual/libudev:=
67 + app-arch/bzip2:=
68 + app-arch/lz4:=
69 + app-arch/snappy:=
70 + >=app-arch/snappy-1.1.9-r1
71 + app-arch/zstd:=
72 + app-shells/bash:0
73 + app-misc/jq:=
74 + dev-libs/crypto++:=
75 + dev-cpp/gflags:=
76 + <dev-libs/leveldb-1.23:=[snappy,tcmalloc(-)?]
77 + dev-libs/libaio:=
78 + >=dev-libs/libfmt-6.2.1:=
79 + <dev-libs/libfmt-9:=
80 + dev-libs/libnl:3=
81 + dev-libs/libxml2:=
82 + dev-libs/libevent:=
83 + dev-libs/libutf8proc:=
84 + dev-libs/openssl:=
85 + <dev-libs/rocksdb-6.15:=
86 + dev-libs/thrift:=
87 + dev-libs/xmlsec:=[openssl]
88 + dev-cpp/yaml-cpp:=
89 + dev-libs/nss:=
90 + dev-python/pyyaml[${PYTHON_USEDEP}]
91 + net-dns/c-ares:=
92 + net-libs/gnutls:=
93 + sys-auth/oath-toolkit:=
94 + sys-apps/coreutils
95 + sys-apps/hwloc:=
96 + sys-apps/keyutils:=
97 + sys-apps/util-linux:=
98 + sys-libs/libcap-ng:=
99 + sys-libs/ncurses:0=
100 + sys-libs/zlib:=
101 + sys-process/numactl:=
102 + virtual/libcrypt:=
103 + x11-libs/libpciaccess:=
104 + babeltrace? ( dev-util/babeltrace )
105 + fuse? ( sys-fs/fuse:3= )
106 + jemalloc? ( dev-libs/jemalloc:= )
107 + !jemalloc? ( >=dev-util/google-perftools-2.6.1:= )
108 + jaeger? (
109 + dev-cpp/nlohmann_json:=
110 + dev-cpp/opentelemetry-cpp:=[jaeger]
111 + )
112 + kafka? ( dev-libs/librdkafka:= )
113 + kerberos? ( virtual/krb5 )
114 + ldap? ( net-nds/openldap:= )
115 + lttng? ( dev-util/lttng-ust:= )
116 + parquet? ( dev-libs/re2:= )
117 + pmdk? ( dev-libs/pmdk:= )
118 + rabbitmq? ( net-libs/rabbitmq-c:= )
119 + radosgw? (
120 + dev-libs/icu:=
121 + dev-libs/expat:=
122 + net-misc/curl:=[curl_ssl_openssl]
123 + )
124 + rbd-rwl? ( dev-libs/pmdk:= )
125 + rdma? ( sys-cluster/rdma-core:= )
126 + spdk? ( dev-util/cunit )
127 + sqlite? ( dev-db/sqlite:= )
128 + system-boost? ( >=dev-libs/boost-1.72:=[threads(+),context,python,${PYTHON_USEDEP},zlib] )
129 + uring? ( sys-libs/liburing:= )
130 + xfs? ( sys-fs/xfsprogs:= )
131 + zbd? ( sys-block/libzbd:= )
132 + zfs? ( sys-fs/zfs:= )
133 +"
134 +BDEPEND="
135 + amd64? ( dev-lang/nasm )
136 + x86? ( dev-lang/yasm )
137 + app-arch/cpio
138 + >=dev-util/cmake-3.5.0
139 + dev-python/cython[${PYTHON_USEDEP}]
140 + dev-python/setuptools[${PYTHON_USEDEP}]
141 + dev-python/sphinx
142 + dev-util/gperf
143 + dev-util/ragel
144 + dev-util/valgrind
145 + sys-apps/coreutils
146 + sys-apps/grep
147 + sys-apps/sed
148 + sys-apps/util-linux
149 + sys-apps/which
150 + sys-devel/bc
151 + sys-devel/patch
152 + virtual/pkgconfig
153 + jaeger? (
154 + sys-devel/bison
155 + sys-devel/flex
156 + )
157 + test? (
158 + dev-util/cunit
159 + dev-python/coverage[${PYTHON_USEDEP}]
160 + dev-python/virtualenv[${PYTHON_USEDEP}]
161 + dev-python/requests-mock[${PYTHON_USEDEP}]
162 + sys-apps/grep[pcre]
163 + sys-fs/btrfs-progs
164 + )
165 +"
166 +RDEPEND="
167 + ${DEPEND}
168 + app-admin/sudo
169 + net-misc/socat
170 + sys-apps/gptfdisk
171 + sys-apps/nvme-cli
172 + >=sys-apps/smartmontools-7.0
173 + sys-block/parted
174 + sys-fs/cryptsetup
175 + sys-fs/lsscsi
176 + sys-fs/lvm2[-device-mapper-only(-)]
177 + virtual/awk
178 + dev-python/bcrypt[${PYTHON_USEDEP}]
179 + dev-python/cherrypy[${PYTHON_USEDEP}]
180 + dev-python/python-dateutil[${PYTHON_USEDEP}]
181 + dev-python/flask[${PYTHON_USEDEP}]
182 + dev-python/jinja[${PYTHON_USEDEP}]
183 + dev-python/pecan[${PYTHON_USEDEP}]
184 + dev-python/prettytable[${PYTHON_USEDEP}]
185 + dev-python/pyopenssl[${PYTHON_USEDEP}]
186 + dev-python/requests[${PYTHON_USEDEP}]
187 + dev-python/werkzeug[${PYTHON_USEDEP}]
188 + mgr? (
189 + dev-python/jsonpatch[${PYTHON_USEDEP}]
190 + dev-python/more-itertools[${PYTHON_USEDEP}]
191 + dev-python/numpy[${PYTHON_USEDEP}]
192 + dev-python/pyjwt[${PYTHON_USEDEP}]
193 + dev-python/routes[${PYTHON_USEDEP}]
194 + diskprediction? (
195 + >=dev-python/scipy-1.4.0[${PYTHON_USEDEP}]
196 + )
197 + sci-libs/scikit-learn[${PYTHON_USEDEP}]
198 + dev-python/six[${PYTHON_USEDEP}]
199 + )
200 +"
201 +# diskprediction needs older scipy not compatible with py38
202 +# bug #724438
203 +REQUIRED_USE="
204 + ${PYTHON_REQUIRED_USE}
205 + ${LUA_REQUIRED_USE}
206 + ?? ( jemalloc tcmalloc )
207 + diskprediction? ( mgr )
208 + kafka? ( radosgw )
209 + mgr? ( cephfs )
210 + rabbitmq? ( radosgw )
211 + rgw-lua? ( radosgw )
212 +"
213 +
214 +RESTRICT="
215 + !test? ( test )
216 +"
217 +
218 +# tests need root access, and network access
219 +RESTRICT+="test"
220 +
221 +# false positives unless all USE flags are on
222 +CMAKE_WARN_UNUSED_CLI=no
223 +
224 +PATCHES=(
225 + "${FILESDIR}/ceph-12.2.0-use-provided-cpu-flag-values.patch"
226 + "${FILESDIR}/ceph-14.2.0-cflags.patch"
227 + "${FILESDIR}/ceph-12.2.4-boost-build-none-options.patch"
228 + "${FILESDIR}/ceph-16.2.2-cflags.patch"
229 + "${FILESDIR}/ceph-17.2.1-no-virtualenvs.patch"
230 + "${FILESDIR}/ceph-13.2.2-dont-install-sysvinit-script.patch"
231 + "${FILESDIR}/ceph-14.2.0-dpdk-cflags.patch"
232 + "${FILESDIR}/ceph-16.2.0-rocksdb-cmake.patch"
233 + "${FILESDIR}/ceph-16.2.0-spdk-tinfo.patch"
234 + "${FILESDIR}/ceph-16.2.0-jaeger-system-boost.patch"
235 + "${FILESDIR}/ceph-16.2.0-liburing.patch"
236 + "${FILESDIR}/ceph-17.2.0-cyclic-deps.patch"
237 + "${FILESDIR}/ceph-17.2.0-pybind-boost-1.74.patch"
238 + "${FILESDIR}/ceph-17.2.0-findre2.patch"
239 + "${FILESDIR}/ceph-17.2.0-install-dbstore.patch"
240 + "${FILESDIR}/ceph-17.2.0-deprecated-boost.patch"
241 + "${FILESDIR}/ceph-17.2.0-system-opentelemetry.patch"
242 + "${FILESDIR}/ceph-17.2.0-fuse3.patch"
243 + "${FILESDIR}/ceph-17.2.0-osd_class_dir.patch"
244 + "${FILESDIR}/ceph-17.2.1-python310.patch"
245 + "${FILESDIR}/ceph-17.2.3-gcc12.patch"
246 + "${FILESDIR}/ceph-17.2.0-gcc12-dout.patch"
247 + "${FILESDIR}/ceph-17.2.0-gcc12-header.patch"
248 +)
249 +
250 +check-reqs_export_vars() {
251 + CHECKREQS_DISK_BUILD="6G"
252 +
253 + if use system-boost; then
254 + CHECKREQS_DISK_USR="350M"
255 + else
256 + CHECKREQS_DISK_USR="510M"
257 + fi
258 +
259 + export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR
260 +}
261 +
262 +pkg_pretend() {
263 + check-reqs_export_vars
264 + check-reqs_pkg_pretend
265 +}
266 +
267 +pkg_setup() {
268 + python_setup
269 + lua_setup
270 + check-reqs_export_vars
271 + check-reqs_pkg_setup
272 +}
273 +
274 +src_prepare() {
275 + cmake_src_prepare
276 +
277 + if use system-boost; then
278 + find "${S}" -name '*.cmake' -or -name 'CMakeLists.txt' -print0 \
279 + | xargs --null sed -r \
280 + -e 's|Boost::|boost_|g' \
281 + -e 's|Boost_|boost_|g' \
282 + -e 's|[Bb]oost_boost|boost_system|g' \
283 + -i || die
284 + fi
285 +
286 + if ! use systemd; then
287 + find "${S}"/src/ceph-volume/ceph_volume -name '*.py' -print0 \
288 + | xargs --null sed \
289 + -e '/^from ceph_volume.systemd import systemctl/ d' \
290 + -i || die
291 + fi
292 +
293 + sed -r -e "s:DESTINATION .+\\):DESTINATION $(get_bashcompdir)\\):" \
294 + -i src/bash_completion/CMakeLists.txt || die
295 +
296 + sed -e "s:objdump -p:$(tc-getOBJDUMP) -p:" -i CMakeLists.txt || die
297 +
298 + # force lua version to use selected version
299 + local lua_version
300 + lua_version=$(ver_cut 1-2 $(lua_get_version))
301 + sed "s:find_package(Lua [0-9][.][0-9] REQUIRED):find_package(Lua ${lua_version} EXACT REQUIRED):" \
302 + -i src/CMakeLists.txt
303 +
304 + # remove tests that need root access
305 + rm src/test/cli/ceph-authtool/cap*.t || die
306 +}
307 +
308 +ceph_src_configure() {
309 + local mycmakeargs=(
310 + -DWITH_BABELTRACE:BOOL=$(usex babeltrace)
311 + -DWITH_BLUESTORE_PMEM:BOOL=$(usex pmdk)
312 + -DWITH_CEPHFS:BOOL=$(usex cephfs)
313 + -DWITH_CEPHFS_SHELL:BOOL=$(usex cephfs)
314 + -DWITH_DPDK:BOOL=$(usex dpdk)
315 + -DWITH_SPDK:BOOL=$(usex spdk)
316 + -DWITH_FUSE:BOOL=$(usex fuse)
317 + -DWITH_LTTNG:BOOL=$(usex lttng)
318 + -DWITH_GSSAPI:BOOL=$(usex kerberos)
319 + -DWITH_GRAFANA:BOOL=$(usex grafana)
320 + -DWITH_MGR:BOOL=$(usex mgr)
321 + -DWITH_MGR_DASHBOARD_FRONTEND:BOOL=OFF
322 + -DWITH_OPENLDAP:BOOL=$(usex ldap)
323 + -DWITH_PYTHON3:STRING=3
324 + -DWITH_RADOSGW:BOOL=$(usex radosgw)
325 + -DWITH_RADOSGW_AMQP_ENDPOINT:BOOL=$(usex rabbitmq)
326 + -DWITH_RADOSGW_KAFKA_ENDPOINT:BOOL=$(usex kafka)
327 + -DWITH_RADOSGW_LUA_PACKAGES:BOOL=$(usex rgw-lua "$(usex radosgw)" "NO")
328 + -DWITH_RBD_RWL:BOOL=$(usex rbd-rwl)
329 + -DWITH_RBD_SSD_CACHE:BOOL=$(usex rbd-ssd)
330 + -DWITH_SYSTEMD:BOOL=$(usex systemd)
331 + -DWITH_TESTS:BOOL=$(usex test)
332 + -DWITH_LIBURING:BOOL=$(usex uring)
333 + -DWITH_SYSTEM_LIBURING:BOOL=$(usex uring)
334 + -DWITH_LIBCEPHSQLITE:BOOL=$(usex sqlite)
335 + -DWITH_XFS:BOOL=$(usex xfs)
336 + -DWITH_ZBD:BOOL=$(usex zbd)
337 + -DWITH_ZFS:BOOL=$(usex zfs)
338 + -DENABLE_SHARED:BOOL=ON
339 + -DALLOCATOR:STRING=$(usex tcmalloc 'tcmalloc' "$(usex jemalloc 'jemalloc' 'libc')")
340 + -DWITH_SYSTEM_PMDK:BOOL=$(usex pmdk 'YES' "$(usex rbd-rwl '')")
341 + -DWITH_SYSTEM_BOOST:BOOL=$(usex system-boost)
342 + -DWITH_SYSTEM_ROCKSDB:BOOL=ON
343 + -DWITH_SYSTEM_ZSTD:BOOL=ON
344 + -DWITH_RDMA:BOOL=$(usex rdma)
345 + -DCMAKE_INSTALL_DOCDIR:PATH="${EPREFIX}/usr/share/doc/${PN}-${PVR}"
346 + -DCMAKE_INSTALL_SYSCONFDIR:PATH="${EPREFIX}/etc"
347 + -Wno-dev
348 + )
349 +
350 + # this breaks when re-configuring for python impl
351 + if [[ ${EBUILD_PHASE} == configure ]]; then
352 + mycmakeargs+=(
353 + -DWITH_JAEGER:BOOL=$(usex jaeger)
354 + -DWITH_RADOSGW_SELECT_PARQUET:BOOL=$(usex parquet)
355 + )
356 + else
357 + mycmakeargs+=(
358 + -DWITH_RADOSGW_SELECT_PARQUET:BOOL=OFF
359 + )
360 + fi
361 +
362 + # conditionally used cmake args
363 + use test && mycmakearts+=( -DWITH_SYSTEM_GTEST:BOOL=$(usex test) )
364 + use systemd && mycmakeargs+=( -DSYSTEMD_SYSTEM_UNIT_DIR:PATH=$(systemd_get_systemunitdir) )
365 +
366 + if use amd64 || use x86; then
367 + local flag
368 + for flag in "${CPU_FLAGS_X86[@]}"; do
369 + case "${flag}" in
370 + avx*)
371 + local var=${flag%f}
372 + mycmakeargs+=(
373 + "-DHAVE_NASM_X64_${var^^}:BOOL=$(usex cpu_flags_x86_${flag})"
374 + )
375 + ;;
376 + *) mycmakeargs+=(
377 + "-DHAVE_INTEL_${flag^^}:BOOL=$(usex cpu_flags_x86_${flag})"
378 + );;
379 + esac
380 + done
381 + fi
382 +
383 + # needed for >=glibc-2.32
384 + has_version '>=sys-libs/glibc-2.32' && mycmakeargs+=( -DWITH_REENTRANT_STRSIGNAL:BOOL=ON )
385 +
386 + rm -f "${BUILD_DIR:-${S}}/CMakeCache.txt" \
387 + || die "failed to remove cmake cache"
388 +
389 + # hopefully this will not be necessary in the next release
390 + use parquet && export ARROW_XSIMD_URL="file:///${DISTDIR}/ceph-xsimd-${PV}.tar.gz"
391 +
392 + cmake_src_configure
393 +
394 + # bug #630232
395 + sed -i "s:\"${T//:\\:}/${EPYTHON}/bin/python\":\"${PYTHON}\":" \
396 + "${BUILD_DIR:-${S}}"/include/acconfig.h \
397 + || die "sed failed"
398 +}
399 +
400 +src_configure() {
401 + use custom-cflags || strip-flags
402 + ceph_src_configure
403 +}
404 +
405 +src_compile() {
406 + cmake_build all
407 +
408 + # we have to do this here to prevent from building everything multiple times
409 + python_copy_sources
410 + python_foreach_impl python_compile
411 +}
412 +
413 +python_compile() {
414 + local CMAKE_USE_DIR="${S}"
415 + ceph_src_configure
416 +
417 + cmake_build src/pybind/CMakeFiles/cython_modules
418 +}
419 +
420 +src_install() {
421 + python_foreach_impl python_install
422 +
423 + python_setup
424 + cmake_src_install
425 +
426 + find "${ED}" -name '*.la' -type f -delete || die
427 +
428 + exeinto /usr/$(get_libdir)/ceph
429 + newexe "${BUILD_DIR}/bin/init-ceph" init-ceph
430 +
431 + insinto /etc/logrotate.d/
432 + newins "${FILESDIR}"/ceph.logrotate-r2 ${PN}
433 +
434 + keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat
435 +
436 + fowners -R ceph:ceph /var/log/ceph
437 +
438 + newinitd "${FILESDIR}/rbdmap.initd-r1" rbdmap
439 + newinitd "${FILESDIR}/${PN}.initd-r12" ${PN}
440 + newconfd "${FILESDIR}/${PN}.confd-r5" ${PN}
441 +
442 + insinto /etc/sudoers.d
443 + doins sudoers.d/*
444 +
445 + insinto /etc/sysctl.d
446 + newins "${FILESDIR}"/sysctld 90-${PN}.conf
447 +
448 + use tcmalloc && newenvd "${FILESDIR}"/envd-tcmalloc 99${PN}-tcmalloc
449 +
450 + # units aren't installed by the build system unless systemd is enabled
451 + # so no point installing these with the USE flag disabled
452 + if use systemd; then
453 + systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" "ceph-mds@.service"
454 + systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" "ceph-osd@.service"
455 + fi
456 +
457 + udev_dorules udev/*.rules
458 + newtmpfiles "${FILESDIR}"/ceph-tmpfilesd ${PN}.conf
459 +
460 + readme.gentoo_create_doc
461 +
462 + # bug #630232
463 + sed -i -r "s:${T//:/\\:}/${EPYTHON}:/usr:" "${ED}"/usr/bin/ceph{,-crash} \
464 + || die "sed failed"
465 +
466 + python_fix_shebang "${ED}"/usr/{,s}bin/
467 +
468 + # python_fix_shebang apparently is not idempotent
469 + local shebang_regex='(/usr/lib/python-exec/python[0-9]\.[0-9]/python)[0-9]\.[0-9]'
470 + grep -r -E -l --null "${shebang_regex}" "${ED}"/usr/{s,}bin/ \
471 + | xargs --null --no-run-if-empty -- sed -i -r "s:${shebang_regex}:\1:" || die
472 +
473 + local -a rados_classes=( "${ED}/usr/$(get_libdir)/rados-classes"/* )
474 + dostrip -x "${rados_classes[@]#${ED}}"
475 +}
476 +
477 +python_install() {
478 + local CMAKE_USE_DIR="${S}"
479 + DESTDIR="${ED}" cmake_build src/pybind/install
480 +
481 + python_optimize
482 +}
483 +
484 +pkg_postinst() {
485 + readme.gentoo_print_elog
486 + tmpfiles_process ${PN}.conf
487 + udev_reload
488 +}
489
490 diff --git a/sys-cluster/ceph/files/ceph-17.2.0-gcc12-dout.patch b/sys-cluster/ceph/files/ceph-17.2.0-gcc12-dout.patch
491 new file mode 100644
492 index 000000000000..d119bf1bf11d
493 --- /dev/null
494 +++ b/sys-cluster/ceph/files/ceph-17.2.0-gcc12-dout.patch
495 @@ -0,0 +1,42 @@
496 +From 841806de212226921eeaeb3eea054bda8ccce616 Mon Sep 17 00:00:00 2001
497 +From: Radoslaw Zarzynski <rzarzyns@××××××.com>
498 +Date: Wed, 19 Jan 2022 15:24:11 +0000
499 +Subject: [PATCH 2/2] common: fix FTBFS due to dout & need_dynamic on GCC-12
500 +
501 +For details see:
502 +https://gist.github.com/rzarzynski/d6d2df6888923bef6a3e764f4856853f.
503 +
504 +Special thanks to Kaleb Keithley who reported the issue
505 +and tested the fix!
506 +
507 +Fixes: https://tracker.ceph.com/issues/53896
508 +Signed-off-by: Radoslaw Zarzynski <rzarzyns@××××××.com>
509 +
510 +Upstream-Status: Backport [963d756ded40f5adf2efef53893c917bec1845c1]
511 +Signed-off-by: Chen Qi <Qi.Chen@×××××××××.com>
512 +---
513 + src/common/dout.h | 5 +++--
514 + 1 file changed, 3 insertions(+), 2 deletions(-)
515 +
516 +diff --git a/src/common/dout.h b/src/common/dout.h
517 +index c7c08182..42f49915 100644
518 +--- a/src/common/dout.h
519 ++++ b/src/common/dout.h
520 +@@ -99,11 +99,12 @@ namespace ceph::dout {
521 + template<typename T>
522 + struct dynamic_marker_t {
523 + T value;
524 +- operator T() const { return value; }
525 ++ // constexpr ctor isn't needed as it's an aggregate type
526 ++ constexpr operator T() const { return value; }
527 + };
528 +
529 + template<typename T>
530 +-dynamic_marker_t<T> need_dynamic(T&& t) {
531 ++constexpr dynamic_marker_t<T> need_dynamic(T&& t) {
532 + return dynamic_marker_t<T>{ std::forward<T>(t) };
533 + }
534 +
535 +--
536 +2.36.0
537 +
538
539 diff --git a/sys-cluster/ceph/files/ceph-17.2.0-gcc12-header.patch b/sys-cluster/ceph/files/ceph-17.2.0-gcc12-header.patch
540 new file mode 100644
541 index 000000000000..70d3eb94c97a
542 --- /dev/null
543 +++ b/sys-cluster/ceph/files/ceph-17.2.0-gcc12-header.patch
544 @@ -0,0 +1,30 @@
545 +From 496465d9238109a93612e28682273e5bf576823b Mon Sep 17 00:00:00 2001
546 +From: Chen Qi <Qi.Chen@×××××××××.com>
547 +Date: Sun, 22 May 2022 19:40:59 -0700
548 +Subject: [PATCH 1/2] buffer.h: add missing header file due to gcc upgrade
549 +
550 +The header file <memory> have been changed to be no longer included by other
551 +heades, thus requiring explicit include. See https://gcc.gnu.org/gcc-12/porting_to.html
552 +
553 +Upstream-Status: Pending
554 +
555 +Signed-off-by: Chen Qi <Qi.Chen@×××××××××.com>
556 +---
557 + src/include/buffer.h | 1 +
558 + 1 file changed, 1 insertion(+)
559 +
560 +diff --git a/src/include/buffer.h b/src/include/buffer.h
561 +index 5c8b427d..88845ee6 100644
562 +--- a/src/include/buffer.h
563 ++++ b/src/include/buffer.h
564 +@@ -43,6 +43,7 @@
565 + #include <list>
566 + #include <vector>
567 + #include <string>
568 ++#include <memory>
569 + #if __cplusplus >= 201703L
570 + #include <string_view>
571 + #endif // __cplusplus >= 201703L
572 +--
573 +2.36.0
574 +