summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-01-02 00:29:41 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-07 12:24:57 +0000
commit992d59564b84333740e6465ec696238274b73938 (patch)
treebadfe791263fd3c10ff83e7c37f276c4c18c60fe /meta/recipes-connectivity/connman
parent0638e664c06fa71a5cab6044898fc95c8afd7f92 (diff)
downloadpoky-992d59564b84333740e6465ec696238274b73938.tar.gz
connman: Fix build with musl
(From OE-Core rev: d0139bcbe0499e570f02f8f7b7e364763f7359ec) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/connman')
-rw-r--r--meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch55
-rw-r--r--meta/recipes-connectivity/connman/connman_1.42.bb1
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch b/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch
new file mode 100644
index 0000000000..8012606db7
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch
@@ -0,0 +1,55 @@
1From cbba6638986c2de763981bf6fc59df6a86fed44f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 1 Jan 2024 17:42:21 -0800
4Subject: [PATCH v2] src/log.c: Include libgen.h for basename API
5
6Use POSIX version of basename. This comes to front with latest musl
7which dropped the declaration from string.h [1] it fails to build with
8clang-17+ because it treats implicit function declaration as error.
9
10Fix it by applying the basename on a copy of string since posix version
11may modify the input string.
12
13[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
14
15Upstream-Status: Submitted [https://lore.kernel.org/connman/20240102015917.3732089-1-raj.khem@gmail.com/T/#u]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18
19 src/log.c | 6 ++++--
20 1 file changed, 4 insertions(+), 2 deletions(-)
21
22diff --git a/src/log.c b/src/log.c
23index 554b046..2df3af7 100644
24--- a/src/log.c
25+++ b/src/log.c
26@@ -24,6 +24,7 @@
27 #endif
28
29 #include <stdio.h>
30+#include <libgen.h>
31 #include <unistd.h>
32 #include <stdarg.h>
33 #include <stdlib.h>
34@@ -196,6 +197,7 @@ int __connman_log_init(const char *program, const char *debug,
35 const char *program_name, const char *program_version)
36 {
37 static char path[PATH_MAX];
38+ char* tmp = strdup(program);
39 int option = LOG_NDELAY | LOG_PID;
40
41 program_exec = program;
42@@ -212,8 +214,8 @@ int __connman_log_init(const char *program, const char *debug,
43 if (backtrace)
44 signal_setup(signal_handler);
45
46- openlog(basename(program), option, LOG_DAEMON);
47-
48+ openlog(basename(tmp), option, LOG_DAEMON);
49+ free(tmp);
50 syslog(LOG_INFO, "%s version %s", program_name, program_version);
51
52 return 0;
53--
542.43.0
55
diff --git a/meta/recipes-connectivity/connman/connman_1.42.bb b/meta/recipes-connectivity/connman/connman_1.42.bb
index c2fcd617ae..91ab9895ac 100644
--- a/meta/recipes-connectivity/connman/connman_1.42.bb
+++ b/meta/recipes-connectivity/connman/connman_1.42.bb
@@ -6,6 +6,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
6 file://connman \ 6 file://connman \
7 file://no-version-scripts.patch \ 7 file://no-version-scripts.patch \
8 file://0001-vpn-Adding-support-for-latest-pppd-2.5.0-release.patch \ 8 file://0001-vpn-Adding-support-for-latest-pppd-2.5.0-release.patch \
9 file://0001-src-log.c-Include-libgen.h-for-basename-API.patch \
9 " 10 "
10 11
11SRC_URI:append:libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch" 12SRC_URI:append:libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"