diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2023-05-03 08:38:57 +0200 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-05-08 18:41:38 -0400 |
commit | f6d4c34ac9dcd726cd01aac7525a1ca92eaa4f96 (patch) | |
tree | 1fb8fa273f73650c2fd139f8c7cb2a8f05372e09 /recipes-extended | |
parent | d1b6bf580edb2ee2dce806a80994601366e3c0cd (diff) | |
download | meta-virtualization-f6d4c34ac9dcd726cd01aac7525a1ca92eaa4f96.tar.gz |
ceph: fix build with gcc-13
* this isn't complete fix as there are still issues from new boost as in:
https://github.com/boostorg/phoenix/issues/111
http://errors.yoctoproject.org/Errors/Details/702743/
TOPDIR/tmp-glibc/work/core2-64-oe-linux/ceph/15.2.15-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/13.1.0/ld: CMakeFiles/common-objs.dir/mon/MonCap.cc.o:/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:43: multiple definition of `boost::phoenix::placeholders::uarg10'; common/CMakeFiles/common-common-objs.dir/ConfUtils.cc.o:/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:43: first defined here
* probably easiest fix for above would be to upgrade to newer ceph, but
I'm not using it, so couldn't properly test it (I was just looking
at bitbake world failures in mickledore
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended')
4 files changed, 175 insertions, 0 deletions
diff --git a/recipes-extended/ceph/ceph/0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch b/recipes-extended/ceph/ceph/0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch new file mode 100644 index 00000000..b6ba82b6 --- /dev/null +++ b/recipes-extended/ceph/ceph/0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 59e6b44f7ed4020a860e347322acfdacc6e4560b Mon Sep 17 00:00:00 2001 | ||
2 | From: Sam James <sam@gentoo.org> | ||
3 | Date: Fri, 28 Oct 2022 16:47:38 +0100 | ||
4 | Subject: [PATCH] common: fix build with GCC 13 (missing <cstdint> include) | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Needed for uint8_t. Only worked by chance before (see | ||
10 | https://www.gnu.org/software/gcc/gcc-13/porting_to.html). | ||
11 | |||
12 | ``` | ||
13 | FAILED: src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o | ||
14 | /usr/bin/x86_64-pc-linux-gnu-g++ -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D__CEPH__ -D__STDC_FORMAT_MACROS -D__linux__ -I/var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5_build/src/include -I/var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src -isystem /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5_build/include -isystem /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/xxHash -isystem /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/rapidjson/include -O2 -march=native -pipe -fPIC -U_FORTIFY_SOURCE -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -std=c++17 -MD -MT src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o -MF src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o.d -o src/CMakeFiles/common-objs.dir/mds/FSMapUser.cc.o -c /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/FSMapUser.cc | ||
15 | In file included from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/log/SubsystemMap.h:12, | ||
16 | from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/common/config.h:23, | ||
17 | from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/mdstypes.h:13, | ||
18 | from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/FSMapUser.h:21, | ||
19 | from /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/mds/FSMapUser.cc:1: | ||
20 | /var/tmp/portage/sys-cluster/ceph-17.2.5/work/ceph-17.2.5/src/common/subsys_types.h:56:23: error: ‘uint8_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’? | ||
21 | ``` | ||
22 | |||
23 | Bug: https://bugs.gentoo.org/878531 | ||
24 | Signed-off-by: Sam James <sam@gentoo.org> | ||
25 | Upstream-Status: Backport [https://github.com/ceph/ceph/commit/74794f9d6f5c6671438085bdba730b504901a7c0] | ||
26 | --- | ||
27 | src/common/subsys_types.h | 1 + | ||
28 | 1 file changed, 1 insertion(+) | ||
29 | |||
30 | diff --git a/src/common/subsys_types.h b/src/common/subsys_types.h | ||
31 | index 52171809..bd7cc439 100644 | ||
32 | --- a/src/common/subsys_types.h | ||
33 | +++ b/src/common/subsys_types.h | ||
34 | @@ -17,6 +17,7 @@ | ||
35 | |||
36 | #include <algorithm> | ||
37 | #include <array> | ||
38 | +#include <cstdint> | ||
39 | |||
40 | enum ceph_subsys_id_t { | ||
41 | ceph_subsys_, // default | ||
diff --git a/recipes-extended/ceph/ceph/0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch b/recipes-extended/ceph/ceph/0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch new file mode 100644 index 00000000..4f46d223 --- /dev/null +++ b/recipes-extended/ceph/ceph/0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch | |||
@@ -0,0 +1,101 @@ | |||
1 | From cca3144aca7f7c19772065421f9b02205a84e0b8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Casey Bodley <cbodley@redhat.com> | ||
3 | Date: Tue, 15 Feb 2022 18:27:10 -0500 | ||
4 | Subject: [PATCH] common: replace BitVector::NoInitAllocator with wrapper | ||
5 | struct | ||
6 | |||
7 | in c++20, the deprecated `struct std::allocator<T>::rebind` template was | ||
8 | removed, so `BitVector` no longer compiles. without a `rebind` to | ||
9 | inherit, `std::allocator_traits<NoInitAllocator>::rebind_alloc<U>` was | ||
10 | looking for `NoInitAllocator<U>`, but it isn't a template class | ||
11 | |||
12 | further investigation found that in c++17, `vector<__u32, NoInitAllocator>` | ||
13 | was rebinding this `NoInitAllocator` to `std::allocator<__u32>` and | ||
14 | preventing the no-init optimization from taking effect | ||
15 | |||
16 | instead of messing with the allocator to avoid zero-initialization, wrap | ||
17 | each __u32 in a struct whose constructor does not initialize the value | ||
18 | |||
19 | Fixes: https://tracker.ceph.com/issues/54279 | ||
20 | |||
21 | Signed-off-by: Casey Bodley <cbodley@redhat.com> | ||
22 | --- | ||
23 | Fixes: | ||
24 | http://errors.yoctoproject.org/Errors/Details/701862/ | ||
25 | |||
26 | Upstream-Status: Backport [https://github.com/ceph/ceph/commit/4f0ad8aab6b21a1fd57a7c1630d298e31b5d9bb6] | ||
27 | |||
28 | src/common/bit_vector.hpp | 27 +++++++++++---------------- | ||
29 | 1 file changed, 11 insertions(+), 16 deletions(-) | ||
30 | |||
31 | diff --git a/src/common/bit_vector.hpp b/src/common/bit_vector.hpp | ||
32 | index 10ee6c3e..9ce3e8b1 100644 | ||
33 | --- a/src/common/bit_vector.hpp | ||
34 | +++ b/src/common/bit_vector.hpp | ||
35 | @@ -223,23 +223,18 @@ public: | ||
36 | |||
37 | static void generate_test_instances(std::list<BitVector *> &o); | ||
38 | private: | ||
39 | - struct NoInitAllocator : public std::allocator<__u32> { | ||
40 | - NoInitAllocator() {} | ||
41 | - NoInitAllocator(const std::allocator<__u32>& alloc) | ||
42 | - : std::allocator<__u32>(alloc) { | ||
43 | - } | ||
44 | - | ||
45 | - template <class U, class... Args> | ||
46 | - void construct(U* p, Args&&... args) const { | ||
47 | - } | ||
48 | - }; | ||
49 | - | ||
50 | bufferlist m_data; | ||
51 | uint64_t m_size; | ||
52 | bool m_crc_enabled; | ||
53 | |||
54 | mutable __u32 m_header_crc; | ||
55 | - mutable std::vector<__u32, NoInitAllocator> m_data_crcs; | ||
56 | + | ||
57 | + // inhibit value-initialization when used in std::vector | ||
58 | + struct u32_struct { | ||
59 | + u32_struct() {} | ||
60 | + __u32 val; | ||
61 | + }; | ||
62 | + mutable std::vector<u32_struct> m_data_crcs; | ||
63 | |||
64 | void resize(uint64_t elements, bool zero); | ||
65 | |||
66 | @@ -351,7 +346,7 @@ void BitVector<_b>::encode_data(bufferlist& bl, uint64_t data_byte_offset, | ||
67 | |||
68 | bufferlist bit; | ||
69 | bit.substr_of(m_data, data_byte_offset, len); | ||
70 | - m_data_crcs[data_byte_offset / BLOCK_SIZE] = bit.crc32c(0); | ||
71 | + m_data_crcs[data_byte_offset / BLOCK_SIZE].val = bit.crc32c(0); | ||
72 | |||
73 | bl.claim_append(bit); | ||
74 | data_byte_offset += BLOCK_SIZE; | ||
75 | @@ -385,7 +380,7 @@ void BitVector<_b>::decode_data(bufferlist::const_iterator& it, | ||
76 | bufferlist bit; | ||
77 | bit.append(ptr); | ||
78 | if (m_crc_enabled && | ||
79 | - m_data_crcs[data_byte_offset / BLOCK_SIZE] != bit.crc32c(0)) { | ||
80 | + m_data_crcs[data_byte_offset / BLOCK_SIZE].val != bit.crc32c(0)) { | ||
81 | throw buffer::malformed_input("invalid data block CRC"); | ||
82 | } | ||
83 | data.append(bit); | ||
84 | @@ -499,7 +494,7 @@ void BitVector<_b>::encode_data_crcs(bufferlist& bl, uint64_t offset, | ||
85 | compute_index(offset + length - 1, &index, &shift); | ||
86 | uint64_t end_crc_index = index / BLOCK_SIZE; | ||
87 | while (crc_index <= end_crc_index) { | ||
88 | - __u32 crc = m_data_crcs[crc_index++]; | ||
89 | + __u32 crc = m_data_crcs[crc_index++].val; | ||
90 | ceph::encode(crc, bl); | ||
91 | } | ||
92 | } | ||
93 | @@ -520,7 +515,7 @@ void BitVector<_b>::decode_data_crcs(bufferlist::const_iterator& it, | ||
94 | while (remaining > 0) { | ||
95 | __u32 crc; | ||
96 | ceph::decode(crc, it); | ||
97 | - m_data_crcs[crc_index++] = crc; | ||
98 | + m_data_crcs[crc_index++].val = crc; | ||
99 | --remaining; | ||
100 | } | ||
101 | } | ||
diff --git a/recipes-extended/ceph/ceph/0003-librdb-fix-build-with-gcc-13.patch b/recipes-extended/ceph/ceph/0003-librdb-fix-build-with-gcc-13.patch new file mode 100644 index 00000000..c27d6f3e --- /dev/null +++ b/recipes-extended/ceph/ceph/0003-librdb-fix-build-with-gcc-13.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 937231991bd7e2cd578cf8cb6c1bedf611c5faef Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
3 | Date: Sat, 29 Apr 2023 13:47:43 +0200 | ||
4 | Subject: [PATCH] librdb: fix build with gcc-13 | ||
5 | |||
6 | * fixes: | ||
7 | ceph-15.2.15/src/librbd/api/PoolMetadata.h:28:19: error: 'uint64_t' has not bee | ||
8 | n declared | ||
9 | ceph/15.2.15-r0/ceph-15.2.15/src/librbd/api/PoolMetadata.cc:133:5: error: no declaration matche | ||
10 | s 'int librbd::api::PoolMetadata<ImageCtxT>::list(librados::v14_2_0::IoCtx&, const std::string&, uint64_t, std::map<std::__cxx11::basic_string<cha | ||
11 | r>, ceph::buffer::v15_2_0::list>*)' | ||
12 | |||
13 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
14 | Upstream-Status: Pending | ||
15 | --- | ||
16 | src/librbd/api/PoolMetadata.h | 1 + | ||
17 | 1 file changed, 1 insertion(+) | ||
18 | |||
19 | diff --git a/src/librbd/api/PoolMetadata.h b/src/librbd/api/PoolMetadata.h | ||
20 | index c0a81735..69ab574a 100644 | ||
21 | --- a/src/librbd/api/PoolMetadata.h | ||
22 | +++ b/src/librbd/api/PoolMetadata.h | ||
23 | @@ -7,6 +7,7 @@ | ||
24 | #include "include/buffer_fwd.h" | ||
25 | #include "include/rados/librados_fwd.hpp" | ||
26 | |||
27 | +#include <cstdint> | ||
28 | #include <map> | ||
29 | #include <string> | ||
30 | |||
diff --git a/recipes-extended/ceph/ceph_15.2.15.bb b/recipes-extended/ceph/ceph_15.2.15.bb index 6312fd31..2c5cdf58 100644 --- a/recipes-extended/ceph/ceph_15.2.15.bb +++ b/recipes-extended/ceph/ceph_15.2.15.bb | |||
@@ -23,6 +23,9 @@ SRC_URI = "http://download.ceph.com/tarballs/ceph-${PV}.tar.gz \ | |||
23 | file://0004-kv-rocksdb_cache-implement-methods-required-by-rocks.patch \ | 23 | file://0004-kv-rocksdb_cache-implement-methods-required-by-rocks.patch \ |
24 | file://0005-kv-rocksdb_cache-mark-Shard-const.patch \ | 24 | file://0005-kv-rocksdb_cache-mark-Shard-const.patch \ |
25 | file://0006-rocksdb-build-with-rocksdb-7.y.z.patch \ | 25 | file://0006-rocksdb-build-with-rocksdb-7.y.z.patch \ |
26 | file://0001-common-fix-build-with-GCC-13-missing-cstdint-include.patch \ | ||
27 | file://0002-common-replace-BitVector-NoInitAllocator-with-wrappe.patch \ | ||
28 | file://0003-librdb-fix-build-with-gcc-13.patch \ | ||
26 | " | 29 | " |
27 | 30 | ||
28 | SRC_URI[sha256sum] = "5dccdaff2ebe18d435b32bfc06f8b5f474bf6ac0432a6a07d144b7c56700d0bf" | 31 | SRC_URI[sha256sum] = "5dccdaff2ebe18d435b32bfc06f8b5f474bf6ac0432a6a07d144b7c56700d0bf" |