]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sysvinit: Include libgen.h for basename API
authorKhem Raj <raj.khem@gmail.com>
Sun, 10 Dec 2023 20:25:48 +0000 (12:25 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 13 Dec 2023 11:33:36 +0000 (11:33 +0000)
This fixes build with latest musl which drops basename declaration API from string.h

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-core/sysvinit/sysvinit/0001-hddown-include-libgen.h-for-basename-API.patch [new file with mode: 0644]
meta/recipes-core/sysvinit/sysvinit_3.04.bb

diff --git a/meta/recipes-core/sysvinit/sysvinit/0001-hddown-include-libgen.h-for-basename-API.patch b/meta/recipes-core/sysvinit/sysvinit/0001-hddown-include-libgen.h-for-basename-API.patch
new file mode 100644 (file)
index 0000000..5e4053b
--- /dev/null
@@ -0,0 +1,38 @@
+From a07c1d94e79840c59563741b45e690e77d4f3dfa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 3 Dec 2023 20:09:30 -0800
+Subject: [PATCH] hddown: include libgen.h for basename API
+
+musl has removed the non-prototype declaration of basename from string.h [1] which now results in build errors with clang-17+ compiler
+
+include libgen.h for using the posix declaration of the funciton.
+
+Fixes
+
+hddown.c:135:8: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
+  135 |                         ptr = basename(lnk);
+      |                             ^ ~~~~~~~~~~~~~
+
+[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Upstream-Status: Submitted [https://github.com/slicer69/sysvinit/pull/21]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/hddown.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/hddown.c b/src/hddown.c
+index 7a2cf28..3b31bc0 100644
+--- a/src/hddown.c
++++ b/src/hddown.c
+@@ -24,6 +24,7 @@ char *v_hddown = "@(#)hddown.c  1.02  22-Apr-2003  miquels@cistron.nl";
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+ #endif
++#include <libgen.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-- 
+2.43.0
+
index 76b187c1961ed4e9c5b3ec2f3c6549a9213ad525..6a612468f35c8c332fccc35b96016d2317a86b67 100644 (file)
@@ -21,6 +21,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.xz \
            file://rcS \
            file://bootlogd.init \
            file://01_bootlogd \
+           file://0001-hddown-include-libgen.h-for-basename-API.patch \
            "
 SRC_URI[sha256sum] = "2a621fe6e4528bc91308b74867ddaaebbdf7753f02395c0c5bae817bd2b7e3a5"