summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-08-16 17:48:06 -0700
committerKhem Raj <raj.khem@gmail.com>2023-08-17 08:03:39 -0700
commite86cb4eabd0f16b7ca73517f78b30f140ac7d80a (patch)
tree1a197aefc6e37f90be6c70d99719d43f9736271e
parentce55a4029cbaaf5ddd547c6d61b2011fc02c750d (diff)
downloadmeta-openembedded-e86cb4eabd0f16b7ca73517f78b30f140ac7d80a.tar.gz
python3-protobuf: Fix build errors seen with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-python/recipes-devtools/python/python3-protobuf/0001-message.c-Cast-uintptr_t-types-to-upb_MessageDef.patch57
-rw-r--r--meta-python/recipes-devtools/python/python3-protobuf_4.24.0.bb2
2 files changed, 58 insertions, 1 deletions
diff --git a/meta-python/recipes-devtools/python/python3-protobuf/0001-message.c-Cast-uintptr_t-types-to-upb_MessageDef.patch b/meta-python/recipes-devtools/python/python3-protobuf/0001-message.c-Cast-uintptr_t-types-to-upb_MessageDef.patch
new file mode 100644
index 000000000..89315e3a7
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-protobuf/0001-message.c-Cast-uintptr_t-types-to-upb_MessageDef.patch
@@ -0,0 +1,57 @@
1From 8ce4b50b210d3c0f8de40156d4ba7827bfe16b21 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 16 Aug 2023 17:36:19 -0700
4Subject: [PATCH] message.c: Cast uintptr_t types to upb_MessageDef
5
6This fixes build with clang
7
8python/message.c:1238:49: error: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned long') to parameter of type 'const upb_MessageDef *' (aka 'const struct upb_MessageDef *') [-Wint-conversion]
9 1238 | upb_MessageDef_MiniTable(other->def),
10 | ^~~~~~~~~~
11/mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/python3-protobuf/4.24.0/protobuf-4.24.0/upb/reflection/message_def.h:138:69: note: passing argument to parameter 'm' here
12 138 | const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m);
13 | ^
14python/message.c:1609:69: error: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned long') to parameter of type 'const upb_MessageDef *' (aka 'const struct upb_MessageDef *') [-Wint-conversion]
15 1609 | upb_Message_DeepClone(self->ptr.msg, upb_MessageDef_MiniTable(self->def),
16 | ^~~~~~~~~
17/mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/python3-protobuf/4.24.0/protobuf-4.24.0/upb/reflection/message_def.h:138:69: note: passing argument to parameter 'm' here
18 138 | const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m);
19 | ^
20python/message.c:1611:44: error: incompatible integer to pointer conversion passing 'uintptr_t' (aka 'unsigned long') to parameter of type 'const upb_MessageDef *' (aka 'const struct upb_MessageDef *') [-Wint-conversion]
21 1611 | PyObject* ret = PyUpb_Message_Get(clone, self->def, arena);
22 | ^~~~~~~~~
23
24Upstream-Status: Submitted [https://github.com/protocolbuffers/upb/pull/1492]
25Signed-off-by: Khem Raj <raj.khem@gmail.com>
26---
27 python/message.c | 6 +++---
28 1 file changed, 3 insertions(+), 3 deletions(-)
29
30diff --git a/python/message.c b/python/message.c
31index a01ce16..c418b84 100644
32--- a/python/message.c
33+++ b/python/message.c
34@@ -1235,7 +1235,7 @@ static PyObject* PyUpb_Message_CopyFrom(PyObject* _self, PyObject* arg) {
35 Py_DECREF(tmp);
36
37 upb_Message_DeepCopy(self->ptr.msg, other->ptr.msg,
38- upb_MessageDef_MiniTable(other->def),
39+ upb_MessageDef_MiniTable((const upb_MessageDef*)other->def),
40 PyUpb_Arena_Get(self->arena));
41 PyUpb_Message_SyncSubobjs(self);
42
43@@ -1606,9 +1606,9 @@ PyObject* DeepCopy(PyObject* _self, PyObject* arg) {
44
45 PyObject* arena = PyUpb_Arena_New();
46 upb_Message* clone =
47- upb_Message_DeepClone(self->ptr.msg, upb_MessageDef_MiniTable(self->def),
48+ upb_Message_DeepClone(self->ptr.msg, upb_MessageDef_MiniTable((const upb_MessageDef*)self->def),
49 PyUpb_Arena_Get(arena));
50- PyObject* ret = PyUpb_Message_Get(clone, self->def, arena);
51+ PyObject* ret = PyUpb_Message_Get(clone, (const upb_MessageDef*)self->def, arena);
52 Py_DECREF(arena);
53
54 return ret;
55--
562.41.0
57
diff --git a/meta-python/recipes-devtools/python/python3-protobuf_4.24.0.bb b/meta-python/recipes-devtools/python/python3-protobuf_4.24.0.bb
index fdc80b701..4f7fdf759 100644
--- a/meta-python/recipes-devtools/python/python3-protobuf_4.24.0.bb
+++ b/meta-python/recipes-devtools/python/python3-protobuf_4.24.0.bb
@@ -6,7 +6,7 @@ LICENSE = "BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=53dbfa56f61b90215a9f8f0d527c043d" 6LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=53dbfa56f61b90215a9f8f0d527c043d"
7 7
8inherit pypi setuptools3 8inherit pypi setuptools3
9 9SRC_URI += "file://0001-message.c-Cast-uintptr_t-types-to-upb_MessageDef.patch"
10SRC_URI[sha256sum] = "5d0ceb9de6e08311832169e601d1fc71bd8e8c779f3ee38a97a78554945ecb85" 10SRC_URI[sha256sum] = "5d0ceb9de6e08311832169e601d1fc71bd8e8c779f3ee38a97a78554945ecb85"
11 11
12# http://errors.yoctoproject.org/Errors/Details/184715/ 12# http://errors.yoctoproject.org/Errors/Details/184715/