summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/composefs/composefs_1.0.3.bb8
-rw-r--r--meta-oe/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch75
2 files changed, 3 insertions, 80 deletions
diff --git a/meta-oe/recipes-support/composefs/composefs_1.0.3.bb b/meta-oe/recipes-support/composefs/composefs_1.0.3.bb
index 76c85ce93f..5d4fa9c31c 100644
--- a/meta-oe/recipes-support/composefs/composefs_1.0.3.bb
+++ b/meta-oe/recipes-support/composefs/composefs_1.0.3.bb
@@ -13,11 +13,9 @@ LIC_FILES_CHKSUM = "\
13 file://LICENSE.Apache-2.0;md5=3b83ef96387f14655fc854ddc3c6bd57 \ 13 file://LICENSE.Apache-2.0;md5=3b83ef96387f14655fc854ddc3c6bd57 \
14" 14"
15 15
16SRCREV = "2d5cdcb9176cfe4ccf1761ef6d78e1c48de35649" 16PV .= "+git${SRCPV}"
17SRC_URI = "\ 17SRCREV = "ecef20c18c81943bd17b489ad1484f361b99c792"
18 git://github.com/containers/composefs.git;protocol=https;branch=main \ 18SRC_URI = "git://github.com/containers/composefs.git;protocol=https;branch=main"
19 file://0001-musl-basename-use-portable-implementation-for-basena.patch \
20"
21 19
22S = "${WORKDIR}/git" 20S = "${WORKDIR}/git"
23 21
diff --git a/meta-oe/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch b/meta-oe/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch
deleted file mode 100644
index 49a0b21c6e..0000000000
--- a/meta-oe/recipes-support/composefs/files/0001-musl-basename-use-portable-implementation-for-basena.patch
+++ /dev/null
@@ -1,75 +0,0 @@
1From b21a9d4f10a066cac76bb345d31fdd24afcf3e6f Mon Sep 17 00:00:00 2001
2From: Fathi Boudra <fathi.boudra@linaro.org>
3Date: Tue, 9 Apr 2024 08:47:37 +0200
4Subject: [PATCH] musl: basename: use portable implementation for basename API
5
6musl has removed the non-prototype declaration of basename from string.h which
7now results in build errors with newer clang compilers.
8
9Implement GNU basename behavior using strchr which is portable across libcs.
10
11Fixes:
12| ../../git/tools/mountcomposefs.c:43:20:
13| error: call to undeclared function 'basename'; ISO C99 and later do not
14| support implicit function declarations [-Wimplicit-function-declaration]
15| 43 | const char *bin = basename(argv0);
16| | ^
17| ../../git/tools/mountcomposefs.c:43:14:
18| error: incompatible integer to pointer conversion initializing 'const char *'
19| with an expression of type 'int' [-Wint-conversion]
20| 43 | const char *bin = basename(argv0);
21| | ^ ~~~~~~~~~~~~~~~
22
23For reference:
24https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
25
26Closes: https://github.com/containers/composefs/issues/272
27
28Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
29
30Upstream-Status: Submitted [https://github.com/containers/composefs/pull/273]
31---
32 libcomposefs/lcfs-utils.h | 6 ++++++
33 tools/mkcomposefs.c | 2 +-
34 tools/mountcomposefs.c | 3 ++-
35 3 files changed, 9 insertions(+), 2 deletions(-)
36
37--- a/tools/mountcomposefs.c
38+++ b/tools/mountcomposefs.c
39@@ -37,10 +37,11 @@
40 #include <linux/fsverity.h>
41
42 #include "libcomposefs/lcfs-mount.h"
43+#include "libcomposefs/lcfs-utils.h"
44
45 static void usage(const char *argv0)
46 {
47- const char *bin = basename(argv0);
48+ const char *bin = gnu_basename(argv0);
49 fprintf(stderr,
50 "usage: %s [-t type] [-o opt[,opts..]] IMAGE MOUNTPOINT\n"
51 "Example:\n"
52--- a/libcomposefs/lcfs-utils.h
53+++ b/libcomposefs/lcfs-utils.h
54@@ -161,4 +161,10 @@ static inline void *steal_pointer(void *
55 /* type safety */
56 #define steal_pointer(pp) (0 ? (*(pp)) : (steal_pointer)(pp))
57
58+static inline const char *gnu_basename(const char *filename)
59+{
60+ const char *p = strrchr(filename, '/');
61+ return p ? p+1 : filename;
62+}
63+
64 #endif
65--- a/tools/mkcomposefs.c
66+++ b/tools/mkcomposefs.c
67@@ -315,7 +315,7 @@ static int fill_store(struct lcfs_node_s
68
69 static void usage(const char *argv0)
70 {
71- const char *bin = basename(argv0);
72+ const char *bin = gnu_basename(argv0);
73 fprintf(stderr,
74 "Usage: %s [OPTIONS] SOURCE IMAGE\n"
75 "Options:\n"