]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
attr: Fix build with latest musl
authorKhem Raj <raj.khem@gmail.com>
Sun, 10 Dec 2023 20:25:49 +0000 (12:25 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 13 Dec 2023 11:33:36 +0000 (11:33 +0000)
Include libgen.h to get basename() signature

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-support/attr/attr.inc
meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch [new file with mode: 0644]

index e8835398afad69e86adafa9c16de2043fb953a2d..75d616893a54c7c0a7ee2dbeb69c693b70593e68 100644 (file)
@@ -16,6 +16,7 @@ LIC_FILES_CHKSUM = "file://doc/COPYING;md5=2d0aa14b3fce4694e4f615e30186335f \
 
 SRC_URI = "${SAVANNAH_GNU_MIRROR}/attr/${BP}.tar.gz \
            file://run-ptest \
+           file://0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch \
 "
 
 inherit ptest update-alternatives autotools gettext
diff --git a/meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch b/meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch
new file mode 100644 (file)
index 0000000..1e2bea5
--- /dev/null
@@ -0,0 +1,35 @@
+From 6d9e827bcacf387bb3cfae64bd4fe520168ccad4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 3 Dec 2023 19:29:27 -0800
+Subject: [PATCH] attr.c: Include libgen.h for posix version of basename API
+
+Musl has removed the definition from string.h [1] which results in
+compile failures with clang
+
+| ../attr-2.5.1/tools/attr.c:69:13: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+|    69 |         progname = basename(argv[0]);
+|       |                    ^
+
+[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Upstream-Status: Submitted [https://savannah.nongnu.org/bugs/index.php?64972]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/attr.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/attr.c b/tools/attr.c
+index 312aef1..90dab83 100644
+--- a/tools/attr.c
++++ b/tools/attr.c
+@@ -26,6 +26,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <libgen.h>
+ #include <string.h>
+ #include <locale.h>
+-- 
+2.43.0
+