diff options
Diffstat (limited to 'meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch')
-rw-r--r-- | meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch b/meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch new file mode 100644 index 0000000000..efaedad70b --- /dev/null +++ b/meta/recipes-devtools/mtd/files/0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From 52db447c94974cd946de8d9d7031b91d41ad1280 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@arm.com> | ||
3 | Date: Wed, 26 Feb 2025 18:24:00 +0000 | ||
4 | Subject: [PATCH 3/4] ubifs-utils: link libmissing.a in case execinfo.h isn't | ||
5 | present | ||
6 | |||
7 | On musl execinfo.h doesn't exist, but ubifs-utils uses backtrace() when | ||
8 | reporting errors. This results in build failures under musl. | ||
9 | |||
10 | Handily, libmissing.a already exists with a stub implementation of | ||
11 | backtrace(). | ||
12 | |||
13 | Guard the execinfo.h include and if it isn't available instead include | ||
14 | libmissing.h, and link to libmissing.a to provide backtrace() if needed. | ||
15 | |||
16 | Upstream-Status: Backport [https://github.com/sigma-star/mtd-utils/commit/8a83b306db64d6f60186d4396b0b770163b85b6e] | ||
17 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
18 | Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> | ||
19 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
20 | --- | ||
21 | ubifs-utils/Makemodule.am | 4 ++-- | ||
22 | ubifs-utils/common/defs.h | 5 ++++- | ||
23 | 2 files changed, 6 insertions(+), 3 deletions(-) | ||
24 | |||
25 | diff --git a/ubifs-utils/Makemodule.am b/ubifs-utils/Makemodule.am | ||
26 | index 21ba0597d84a..f84569a6da44 100644 | ||
27 | --- a/ubifs-utils/Makemodule.am | ||
28 | +++ b/ubifs-utils/Makemodule.am | ||
29 | @@ -72,7 +72,7 @@ mkfs_ubifs_SOURCES = \ | ||
30 | ubifs-utils/mkfs.ubifs/mkfs.ubifs.c | ||
31 | |||
32 | mkfs_ubifs_LDADD = libmtd.a libubi.a $(ZLIB_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(UUID_LIBS) $(LIBSELINUX_LIBS) $(OPENSSL_LIBS) \ | ||
33 | - $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread | ||
34 | + $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread libmissing.a | ||
35 | mkfs_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS) \ | ||
36 | -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/common -I $(top_srcdir)/ubifs-utils/libubifs | ||
37 | |||
38 | @@ -90,7 +90,7 @@ fsck_ubifs_SOURCES = \ | ||
39 | ubifs-utils/fsck.ubifs/handle_disconnected.c | ||
40 | |||
41 | fsck_ubifs_LDADD = libmtd.a libubi.a $(ZLIB_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(UUID_LIBS) $(LIBSELINUX_LIBS) $(OPENSSL_LIBS) \ | ||
42 | - $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread | ||
43 | + $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread libmissing.a | ||
44 | fsck_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS) \ | ||
45 | -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/common -I $(top_srcdir)/ubifs-utils/libubifs \ | ||
46 | -I$(top_srcdir)/ubifs-utils/fsck.ubifs | ||
47 | diff --git a/ubifs-utils/common/defs.h b/ubifs-utils/common/defs.h | ||
48 | index 7ff1771674d9..d5edbf67439a 100644 | ||
49 | --- a/ubifs-utils/common/defs.h | ||
50 | +++ b/ubifs-utils/common/defs.h | ||
51 | @@ -13,8 +13,11 @@ | ||
52 | #include <errno.h> | ||
53 | #include <time.h> | ||
54 | #include <assert.h> | ||
55 | +#if HAVE_EXECINFO_H | ||
56 | #include <execinfo.h> | ||
57 | - | ||
58 | +#else | ||
59 | +#include "libmissing.h" | ||
60 | +#endif | ||
61 | #include "ubifs.h" | ||
62 | |||
63 | /* common.h requires the PROGRAM_NAME macro */ | ||
64 | -- | ||
65 | 2.34.1 | ||
66 | |||