diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-09-02 21:40:17 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-09-04 12:38:44 +0100 |
commit | 29d5a5665520b06861af669c212b2aa89676807e (patch) | |
tree | 22b417db20b2aada0505719348b1139a44ae6476 /meta | |
parent | d4f765cb16109ea2f1d806ea94f51860f2f58d54 (diff) | |
download | poky-29d5a5665520b06861af669c212b2aa89676807e.tar.gz |
kea: Replace Name::NameString with vector of uint8_t
This will fix build with libc++ from llvm 19.x
(From OE-Core rev: e3f74aaf3e8bdc6566c6b881e71cfdd3e4eb2c3f)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
3 files changed, 128 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/kea/files/0001-Replace-Name-NameString-with-vector-of-uint8_t.patch b/meta/recipes-connectivity/kea/files/0001-Replace-Name-NameString-with-vector-of-uint8_t.patch new file mode 100644 index 0000000000..a7deeca243 --- /dev/null +++ b/meta/recipes-connectivity/kea/files/0001-Replace-Name-NameString-with-vector-of-uint8_t.patch | |||
@@ -0,0 +1,90 @@ | |||
1 | From 6b9fb56e3573aa65923df9a08201dd5321a1b1f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dimitry Andric <dimitry@andric.com> | ||
3 | Date: Sat, 3 Aug 2024 14:37:52 +0200 | ||
4 | Subject: [PATCH 1/2] Replace Name::NameString with vector of uint8_t | ||
5 | |||
6 | As noted in the libc++ 19 release notes, it now only provides | ||
7 | std::char_traits<> for types char, char8_t, char16_t, char32_t and | ||
8 | wchar_t, and any instantiation for other types will fail. | ||
9 | |||
10 | Name::NameString is defined as a std::basic_string<uint8_t>, so that | ||
11 | will no longer work. Redefine it as a std::vector<uint8_t> instead. | ||
12 | |||
13 | Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/merge_requests/2410] | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | src/lib/dns/name.cc | 12 ++++++------ | ||
17 | src/lib/dns/name.h | 2 +- | ||
18 | 2 files changed, 7 insertions(+), 7 deletions(-) | ||
19 | |||
20 | diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc | ||
21 | index ac48205..085229b 100644 | ||
22 | --- a/src/lib/dns/name.cc | ||
23 | +++ b/src/lib/dns/name.cc | ||
24 | @@ -303,7 +303,7 @@ Name::Name(const std::string &namestring, bool downcase) { | ||
25 | // And get the output | ||
26 | labelcount_ = offsets.size(); | ||
27 | isc_throw_assert(labelcount_ > 0 && labelcount_ <= Name::MAX_LABELS); | ||
28 | - ndata_.assign(ndata.data(), ndata.size()); | ||
29 | + ndata_.assign(ndata.data(), ndata.data() + ndata.size()); | ||
30 | length_ = ndata_.size(); | ||
31 | offsets_.assign(offsets.begin(), offsets.end()); | ||
32 | } | ||
33 | @@ -336,7 +336,7 @@ Name::Name(const char* namedata, size_t data_len, const Name* origin, | ||
34 | // Get the output | ||
35 | labelcount_ = offsets.size(); | ||
36 | isc_throw_assert(labelcount_ > 0 && labelcount_ <= Name::MAX_LABELS); | ||
37 | - ndata_.assign(ndata.data(), ndata.size()); | ||
38 | + ndata_.assign(ndata.data(), ndata.data() + ndata.size()); | ||
39 | length_ = ndata_.size(); | ||
40 | offsets_.assign(offsets.begin(), offsets.end()); | ||
41 | |||
42 | @@ -347,7 +347,7 @@ Name::Name(const char* namedata, size_t data_len, const Name* origin, | ||
43 | // Drop the last character of the data (the \0) and append a copy of | ||
44 | // the origin's data | ||
45 | ndata_.erase(ndata_.end() - 1); | ||
46 | - ndata_.append(origin->ndata_); | ||
47 | + ndata_.insert(ndata.end(), origin->ndata_.begin(), origin->ndata_.end()); | ||
48 | |||
49 | // Do a similar thing with offsets. However, we need to move them | ||
50 | // so they point after the prefix we parsed before. | ||
51 | @@ -582,7 +582,7 @@ Name::concatenate(const Name& suffix) const { | ||
52 | |||
53 | Name retname; | ||
54 | retname.ndata_.reserve(length); | ||
55 | - retname.ndata_.assign(ndata_, 0, length_ - 1); | ||
56 | + retname.ndata_.assign(ndata_.data(), ndata_.data() + length_ - 1); | ||
57 | retname.ndata_.insert(retname.ndata_.end(), | ||
58 | suffix.ndata_.begin(), suffix.ndata_.end()); | ||
59 | isc_throw_assert(retname.ndata_.size() == length); | ||
60 | @@ -622,7 +622,7 @@ Name::reverse() const { | ||
61 | NameString::const_iterator n0 = ndata_.begin(); | ||
62 | retname.offsets_.push_back(0); | ||
63 | while (rit1 != offsets_.rend()) { | ||
64 | - retname.ndata_.append(n0 + *rit1, n0 + *rit0); | ||
65 | + retname.ndata_.insert(retname.ndata_.end(), n0 + *rit1, n0 + *rit0); | ||
66 | retname.offsets_.push_back(retname.ndata_.size()); | ||
67 | ++rit0; | ||
68 | ++rit1; | ||
69 | @@ -662,7 +662,7 @@ Name::split(const unsigned int first, const unsigned int n) const { | ||
70 | // original name, and append the trailing dot explicitly. | ||
71 | // | ||
72 | retname.ndata_.reserve(retname.offsets_.back() + 1); | ||
73 | - retname.ndata_.assign(ndata_, offsets_[first], retname.offsets_.back()); | ||
74 | + retname.ndata_.assign(ndata_.data() + offsets_[first], ndata_.data() + retname.offsets_.back()); | ||
75 | retname.ndata_.push_back(0); | ||
76 | |||
77 | retname.length_ = retname.ndata_.size(); | ||
78 | diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h | ||
79 | index 37723e8..fac0036 100644 | ||
80 | --- a/src/lib/dns/name.h | ||
81 | +++ b/src/lib/dns/name.h | ||
82 | @@ -228,7 +228,7 @@ class Name { | ||
83 | //@{ | ||
84 | private: | ||
85 | /// \brief Name data string | ||
86 | - typedef std::basic_string<uint8_t> NameString; | ||
87 | + typedef std::vector<uint8_t> NameString; | ||
88 | /// \brief Name offsets type | ||
89 | typedef std::vector<uint8_t> NameOffsets; | ||
90 | |||
diff --git a/meta/recipes-connectivity/kea/files/0002-Fix-unittests-Typo-in-Name-Name-append-to-ndata_-not.patch b/meta/recipes-connectivity/kea/files/0002-Fix-unittests-Typo-in-Name-Name-append-to-ndata_-not.patch new file mode 100644 index 0000000000..a24a25f1c9 --- /dev/null +++ b/meta/recipes-connectivity/kea/files/0002-Fix-unittests-Typo-in-Name-Name-append-to-ndata_-not.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From b5f6cc6b3a2b2c35c9b9bb856861c502771079cc Mon Sep 17 00:00:00 2001 | ||
2 | From: Dimitry Andric <dimitry@unified-streaming.com> | ||
3 | Date: Wed, 28 Aug 2024 22:32:44 +0200 | ||
4 | Subject: [PATCH 2/2] Fix unittests: * Typo in `Name::Name`: append to | ||
5 | `ndata_`, not `ndata` * In `Name::split`, use the correct iterators for | ||
6 | assigning | ||
7 | |||
8 | Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/merge_requests/2410] | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | src/lib/dns/name.cc | 5 +++-- | ||
12 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc | ||
15 | index 085229b..47d9b8f 100644 | ||
16 | --- a/src/lib/dns/name.cc | ||
17 | +++ b/src/lib/dns/name.cc | ||
18 | @@ -347,7 +347,7 @@ Name::Name(const char* namedata, size_t data_len, const Name* origin, | ||
19 | // Drop the last character of the data (the \0) and append a copy of | ||
20 | // the origin's data | ||
21 | ndata_.erase(ndata_.end() - 1); | ||
22 | - ndata_.insert(ndata.end(), origin->ndata_.begin(), origin->ndata_.end()); | ||
23 | + ndata_.insert(ndata_.end(), origin->ndata_.begin(), origin->ndata_.end()); | ||
24 | |||
25 | // Do a similar thing with offsets. However, we need to move them | ||
26 | // so they point after the prefix we parsed before. | ||
27 | @@ -662,7 +662,8 @@ Name::split(const unsigned int first, const unsigned int n) const { | ||
28 | // original name, and append the trailing dot explicitly. | ||
29 | // | ||
30 | retname.ndata_.reserve(retname.offsets_.back() + 1); | ||
31 | - retname.ndata_.assign(ndata_.data() + offsets_[first], ndata_.data() + retname.offsets_.back()); | ||
32 | + auto it = ndata_.data() + offsets_[first]; | ||
33 | + retname.ndata_.assign(it, it + retname.offsets_.back()); | ||
34 | retname.ndata_.push_back(0); | ||
35 | |||
36 | retname.length_ = retname.ndata_.size(); | ||
diff --git a/meta/recipes-connectivity/kea/kea_2.6.1.bb b/meta/recipes-connectivity/kea/kea_2.6.1.bb index bd9e63ceed..4f8c4124cb 100644 --- a/meta/recipes-connectivity/kea/kea_2.6.1.bb +++ b/meta/recipes-connectivity/kea/kea_2.6.1.bb | |||
@@ -17,6 +17,8 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.gz \ | |||
17 | file://fix-multilib-conflict.patch \ | 17 | file://fix-multilib-conflict.patch \ |
18 | file://fix_pid_keactrl.patch \ | 18 | file://fix_pid_keactrl.patch \ |
19 | file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ | 19 | file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ |
20 | file://0001-Replace-Name-NameString-with-vector-of-uint8_t.patch \ | ||
21 | file://0002-Fix-unittests-Typo-in-Name-Name-append-to-ndata_-not.patch \ | ||
20 | " | 22 | " |
21 | SRC_URI[sha256sum] = "d2ce14a91c2e248ad2876e29152d647bcc5e433bc68dafad0ee96ec166fcfad1" | 23 | SRC_URI[sha256sum] = "d2ce14a91c2e248ad2876e29152d647bcc5e433bc68dafad0ee96ec166fcfad1" |
22 | 24 | ||