diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-12-10 12:25:49 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-13 11:34:27 +0000 |
commit | bebebac37d3a525125818872361bd71f6d37b1f6 (patch) | |
tree | fdb3f1d5d3440bdd1d038c626fa71491214aa648 | |
parent | ad645dc8b2734cca246eed306873412a464dadff (diff) | |
download | poky-bebebac37d3a525125818872361bd71f6d37b1f6.tar.gz |
attr: Fix build with latest musl
Include libgen.h to get basename() signature
(From OE-Core rev: bc05ad35c02ac63b6c5428111aec3f455b17d75f)
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>
-rw-r--r-- | meta/recipes-support/attr/attr.inc | 1 | ||||
-rw-r--r-- | meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-support/attr/attr.inc b/meta/recipes-support/attr/attr.inc index e8835398af..75d616893a 100644 --- a/meta/recipes-support/attr/attr.inc +++ b/meta/recipes-support/attr/attr.inc | |||
@@ -16,6 +16,7 @@ LIC_FILES_CHKSUM = "file://doc/COPYING;md5=2d0aa14b3fce4694e4f615e30186335f \ | |||
16 | 16 | ||
17 | SRC_URI = "${SAVANNAH_GNU_MIRROR}/attr/${BP}.tar.gz \ | 17 | SRC_URI = "${SAVANNAH_GNU_MIRROR}/attr/${BP}.tar.gz \ |
18 | file://run-ptest \ | 18 | file://run-ptest \ |
19 | file://0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch \ | ||
19 | " | 20 | " |
20 | 21 | ||
21 | inherit ptest update-alternatives autotools gettext | 22 | 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 index 0000000000..1e2bea5067 --- /dev/null +++ b/meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 6d9e827bcacf387bb3cfae64bd4fe520168ccad4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 3 Dec 2023 19:29:27 -0800 | ||
4 | Subject: [PATCH] attr.c: Include libgen.h for posix version of basename API | ||
5 | |||
6 | Musl has removed the definition from string.h [1] which results in | ||
7 | compile failures with clang | ||
8 | |||
9 | | ../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] | ||
10 | | 69 | progname = basename(argv[0]); | ||
11 | | | ^ | ||
12 | |||
13 | [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 | ||
14 | |||
15 | Upstream-Status: Submitted [https://savannah.nongnu.org/bugs/index.php?64972] | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | tools/attr.c | 1 + | ||
19 | 1 file changed, 1 insertion(+) | ||
20 | |||
21 | diff --git a/tools/attr.c b/tools/attr.c | ||
22 | index 312aef1..90dab83 100644 | ||
23 | --- a/tools/attr.c | ||
24 | +++ b/tools/attr.c | ||
25 | @@ -26,6 +26,7 @@ | ||
26 | #include <stdlib.h> | ||
27 | #include <unistd.h> | ||
28 | #include <errno.h> | ||
29 | +#include <libgen.h> | ||
30 | #include <string.h> | ||
31 | #include <locale.h> | ||
32 | |||
33 | -- | ||
34 | 2.43.0 | ||
35 | |||