From 33a7ffe6385a8bca13373b916a40a48ee215f808 Mon Sep 17 00:00:00 2001 From: Hailiang Date: Mon, 10 Mar 2025 14:49:33 +0800 Subject: [PATCH 1/2] update sw_64 patch --- add-sw_64-support.patch | 42 +++++++++++++++++++++++++++++++++++++++++ bluez-5.54-sw.patch | 25 ------------------------ bluez.spec | 11 ++++++----- 3 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 add-sw_64-support.patch delete mode 100644 bluez-5.54-sw.patch diff --git a/add-sw_64-support.patch b/add-sw_64-support.patch new file mode 100644 index 0000000..2e51f62 --- /dev/null +++ b/add-sw_64-support.patch @@ -0,0 +1,42 @@ +From 5e85390c90df59b324ed6fd56102c2c800af076a Mon Sep 17 00:00:00 2001 +From: Hailiang +Date: Mon, 10 Mar 2025 14:46:57 +0800 +Subject: [PATCH] add sw_64 support + +--- + ell/missing.h | 2 ++ + profiles/network/bnep.c | 4 ++++ + 2 files changed, 6 insertions(+) + +diff --git a/ell/missing.h b/ell/missing.h +index b1ee0f1..32eb887 100644 +--- a/ell/missing.h ++++ b/ell/missing.h +@@ -13,6 +13,8 @@ + # define __NR_getrandom 318 + # elif defined(__i386__) + # define __NR_getrandom 355 ++# elif defined(__sw_64__) ++# define __NR_getrandom 511 + # elif defined(__arm__) + # define __NR_getrandom 384 + # elif defined(__aarch64__) +diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c +index 54b9500..49bc12f 100644 +--- a/profiles/network/bnep.c ++++ b/profiles/network/bnep.c +@@ -256,7 +256,11 @@ static gboolean bnep_setup_cb(GIOChannel *chan, GIOCondition cond, + + memset(&timeo, 0, sizeof(timeo)); + timeo.tv_sec = 0; ++#if defined(__sw_64__) ++ if (setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO_OLD, &timeo, ++#else + if (setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO, &timeo, ++#endif + sizeof(timeo)) < 0) { + error("bnep: Set setsockopt failed: %s", strerror(errno)); + goto failed; +-- +2.20.1 + diff --git a/bluez-5.54-sw.patch b/bluez-5.54-sw.patch deleted file mode 100644 index 8d4bdb9..0000000 --- a/bluez-5.54-sw.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nuar bluez-5.54/ell/missing.h bluez-5.54-sw/ell/missing.h ---- bluez-5.54/ell/missing.h 2019-04-03 17:49:21.000000000 +0000 -+++ bluez-5.54-sw/ell/missing.h 2022-07-20 13:43:50.420000000 +0000 -@@ -27,6 +27,8 @@ - # define __NR_getrandom 318 - # elif defined(__i386__) - # define __NR_getrandom 355 -+# elif defined(__sw_64__) -+# define __NR_getrandom 511 - # elif defined(__arm__) - # define __NR_getrandom 384 - # elif defined(__aarch64__) -diff -Nuar bluez-5.54/profiles/network/bnep.c bluez-5.54-sw/profiles/network/bnep.c ---- bluez-5.54/profiles/network/bnep.c 2019-09-19 18:51:03.000000000 +0000 -+++ bluez-5.54-sw/profiles/network/bnep.c 2022-07-20 13:58:58.390000000 +0000 -@@ -268,7 +268,8 @@ - - memset(&timeo, 0, sizeof(timeo)); - timeo.tv_sec = 0; -- setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO, &timeo, sizeof(timeo)); -+/* setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO, &timeo, sizeof(timeo)); */ -+ setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO_OLD, &timeo, sizeof(timeo)); - - sk = g_io_channel_unix_get_fd(session->io); - if (bnep_connadd(sk, session->src, session->iface) < 0) diff --git a/bluez.spec b/bluez.spec index 60c07e2..c122b2f 100644 --- a/bluez.spec +++ b/bluez.spec @@ -1,7 +1,7 @@ Name: bluez Summary: Bluetooth utilities Version: 5.71 -Release: 3 +Release: 4 License: GPLv2+ URL: http://www.bluez.org/ Source0: http://www.kernel.org/pub/linux/bluetooth/bluez-%{version}.tar.xz @@ -14,9 +14,7 @@ Source4: btattach-bcm-service.sh # workaround for broken tests (reported upstream but not yet fixed) # upstream:https://github.com/bluez/bluez/commit/5fc60b2ce7c4370ff8d9bc3d3c3434b212465f40 Patch6000: backport-bluez-disable-test-mesh-crypto.patch -%ifarch sw_64 -Patch6013: bluez-5.54-sw.patch -%endif +Patch6013: add-sw_64-support.patch Patch7000: 0001-Fix-crash-after-pair-command.patch Patch7001: Fix-memory-leak.patch @@ -169,13 +167,16 @@ make check %defattr(-,root,root) %_cups_serverbin/backend/bluetooth -%files help +#%files help %defattr(-,root,root) %{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man8/* %changelog +* Mon Mar 10 2025 mahailiang - 5.71-4 +- update sw_64 patch + * Tue Jun 4 2024 xuchenchen - 5.71-3 - sync patches from community, shared/csip: Fix memory leak -- Gitee From 1849472401ffb3e0af9dca118e3e5a97b7de5445 Mon Sep 17 00:00:00 2001 From: Hailiang Date: Mon, 10 Mar 2025 14:54:02 +0800 Subject: [PATCH 2/2] update sw_64 patch --- bluez.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluez.spec b/bluez.spec index c122b2f..fd9e0a5 100644 --- a/bluez.spec +++ b/bluez.spec @@ -167,7 +167,7 @@ make check %defattr(-,root,root) %_cups_serverbin/backend/bluetooth -#%files help +%files help %defattr(-,root,root) %{_mandir}/man1/* %{_mandir}/man5/* -- Gitee