Skip to contentSkip to conversation

package/bluez5_utils: fix build with libglib2 >= 2.69

PATCH In review Thomas Devoogdt 2 participants 2 messages Feb 6, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/bluez5_utils: fix build with libglib2 >= 2.69

Fix the following build failure raised since bump of libglib2 to version 2.70 in commit 079923d:

profiles/battery/battery.c:162:2: warning: 'g_memdup' is deprecated (declared at /home/buildroot/autobuild/instance-0/output-1/host/bin/../arm-buildroot-linux-gnueabi/sysroot/usr/include/glib-2.0/glib/gstrfuncs.h:257): Use 'g_memdup2' instead [-Wdeprecated-declarations]
batt->initial_value = g_memdup(value, length);

Fixes:
- http://autobuild.buildroot.org/results/6b8/6b8870d12e0804d6154230a7322c49416c1dc0e2/build-end.log

Sources:
- https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=710220f861b100856711a0a4d4a852874228a57a
- https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=9f09e69ecb077082301dafb745856e1f3731aaa7
- https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=cfab569484b18407fc117bb96634525cc76ea1f5

---
[update] removed patch numbers & remve change to 0001-tools-mesh-cfgtest-include-limits.h

 ...til-Rename-btd_malloc-to-util_malloc.patch |   67 +
 .../0003-shared-util-Add-util_memdup.patch    |   57 +
 ...ace-use-of-g_memdup-with-util_memdup.patch | 1411 +++++++++++++++++
 3 files changed, 1535 insertions(+)
 create mode 100644 package/bluez5_utils/0002-shared-util-Rename-btd_malloc-to-util_malloc.patch
 create mode 100644 package/bluez5_utils/0003-shared-util-Add-util_memdup.patch
 create mode 100644 package/bluez5_utils/0004-build-Replace-use-of-g_memdup-with-util_memdup.patch
package/bluez5_utils/0002-shared-util-Rename-btd_malloc-to-util_malloc.patch new file +67 -0
new file mode 100644
index 0000000000..f8d74528d8
@@ -0,0 +1,67 @@
+From f3263fed28bf510a1225661fe2b5f598300c11cd Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <[email protected]>
+Date: Wed, 5 Jan 2022 15:53:35 -0800
+Subject: [PATCH] shared/util: Rename btd_malloc to util_malloc
+
+util functions are not limited to daemon only which is normally the case
+when using btd prefix.
+
+(cherry picked from commit 710220f861b100856711a0a4d4a852874228a57a)
+Signed-off-by: Thomas Devoogdt <[email protected]>
+---
+ profiles/audio/avdtp.c | 2 +-
+ src/shared/util.c      | 2 +-
+ src/shared/util.h      | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
+index d3dfbf96d..f2b461330 100644
+--- a/profiles/audio/avdtp.c
++++ b/profiles/audio/avdtp.c
+@@ -1333,7 +1333,7 @@ static GSList *caps_to_list(uint8_t *data, size_t size,
+ 			break;
+ 		}
+ 
+-		cpy = btd_malloc(sizeof(*cpy) + cap->length);
++		cpy = util_malloc(sizeof(*cpy) + cap->length);
+ 		memcpy(cpy, cap, sizeof(*cap) + cap->length);
+ 
+ 		size -= sizeof(*cap) + cap->length;
+diff --git a/src/shared/util.c b/src/shared/util.c
+index 81b20d86f..93110047b 100644
+--- a/src/shared/util.c
++++ b/src/shared/util.c
+@@ -25,7 +25,7 @@
+ 
+ #include "src/shared/util.h"
+ 
+-void *btd_malloc(size_t size)
++void *util_malloc(size_t size)
+ {
+ 	if (__builtin_expect(!!size, 1)) {
+ 		void *ptr;
+diff --git a/src/shared/util.h b/src/shared/util.h
+index ac70117ca..11d09979d 100644
+--- a/src/shared/util.h
++++ b/src/shared/util.h
+@@ -75,7 +75,7 @@ do {						\
+ 		size_t __n = (size_t) (count);	\
+ 		size_t __s = sizeof(type);	\
+ 		void *__p;			\
+-		__p = btd_malloc(__n * __s);	\
++		__p = util_malloc(__n * __s);	\
+ 		memset(__p, 0, __n * __s);	\
+ 		__p;				\
+ 	}))
+@@ -86,7 +86,7 @@ do {						\
+ char *strdelimit(char *str, char *del, char c);
+ int strsuffix(const char *str, const char *suffix);
+ 
+-void *btd_malloc(size_t size);
++void *util_malloc(size_t size);
+ 
+ typedef void (*util_debug_func_t)(const char *str, void *user_data);
+ 
+-- 
+2.17.1
+
package/bluez5_utils/0003-shared-util-Add-util_memdup.patch new file +57 -0

57 lines not on this page · raw message

package/bluez5_utils/0004-build-Replace-use-of-g_memdup-with-util_memdup.patch new file +1411 -0

1,411 lines not on this page · raw message

Signature · 6 lines
2.17.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Devoogdt <[email protected]> writes:

Fix the following build failure raised since bump of libglib2 to version 2.70 in commit 079923d:

profiles/battery/battery.c:162:2: warning: 'g_memdup' is deprecated (declared at /home/buildroot/autobuild/instance-0/output-1/host/bin/../arm-buildroot-linux-gnueabi/sysroot/usr/include/glib-2.0/glib/gstrfuncs.h:257): Use 'g_memdup2' instead [-Wdeprecated-declarations] batt-> initial_value = g_memdup(value, length);

Fixes:
- http://autobuild.buildroot.org/results/6b8/6b8870d12e0804d6154230a7322c49416c1dc0e2/build-end.log

Quoted 8 lines

Sources:
- https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=710220f861b100856711a0a4d4a852874228a57a
- https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=9f09e69ecb077082301dafb745856e1f3731aaa7
- https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=cfab569484b18407fc117bb96634525cc76ea1f5

---
[update] removed patch numbers & remve change to 0001-tools-mesh-cfgtest-include-limits.h

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot