summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-07-12 14:52:31 -0700
committerKhem Raj <raj.khem@gmail.com>2023-07-13 07:22:17 -0700
commit3645710e73a5a1579d25cc20c26be6f8b0dbe40e (patch)
treebbb8ddd048b377da80bb1be0c203505d01ca7ccb /meta-oe/recipes-kernel
parent3c0b5366abb82676da9b3beb23b4363916045837 (diff)
downloadmeta-openembedded-3645710e73a5a1579d25cc20c26be6f8b0dbe40e.tar.gz
crash: Fix build with glibc 2.38+
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel')
-rw-r--r--meta-oe/recipes-kernel/crash/crash/0001-make-src-string-const-in-strlcpy.patch69
-rw-r--r--meta-oe/recipes-kernel/crash/crash_8.0.2.bb1
2 files changed, 70 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/crash/crash/0001-make-src-string-const-in-strlcpy.patch b/meta-oe/recipes-kernel/crash/crash/0001-make-src-string-const-in-strlcpy.patch
new file mode 100644
index 000000000..546973e0a
--- /dev/null
+++ b/meta-oe/recipes-kernel/crash/crash/0001-make-src-string-const-in-strlcpy.patch
@@ -0,0 +1,69 @@
1From 4ee56105881d7bb1da1e668ac5bb47a4e0846676 Mon Sep 17 00:00:00 2001
2From: Lianbo Jiang <lijiang@redhat.com>
3Date: Wed, 5 Jul 2023 10:02:59 +0800
4Subject: [PATCH] Fix compilation error due to new strlcpy function that glibc
5 added
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10The crash-utility has its own strlcpy(), but recently the latest glibc
11has also implemented the strlcpy function, which is derived from
12OpenBSD. Eventually this caused the following compilation error:
13
14 # make -j8 lzo
15 ...
16 In file included from global_data.c:18:
17 defs.h:5556:8: error: conflicting types for ‘strlcpy’; have ‘size_t(char *, char *, size_t)’ {aka ‘long unsigned int(char *, char *, long unsigned int)’}
18 5556 | size_t strlcpy(char *, char *, size_t);
19 | ^~~~~~~
20 In file included from memory.c:19:
21 defs.h:5556:8: error: conflicting types for ‘strlcpy’; have ‘size_t(char *, char *, size_t)’ {aka ‘long unsigned int(char *, char *, long unsigned int)’}
22 5556 | size_t strlcpy(char *, char *, size_t);
23 | ^~~~~~~
24 ...
25
26To fix the issue, let's declare the strlcpy() as a weak function and
27keep the same parameter types as the glibc function has.
28
29Related glibc commits:
30454a20c8756c ("Implement strlcpy and strlcat [BZ #178]")
31d2fda60e7c40 ("manual: Manual update for strlcat, strlcpy, wcslcat, wclscpy")
32388ae538ddcb ("hurd: Add strlcpy, strlcat, wcslcpy, wcslcat to libc.abilist")
33
34Upstream-Status: Backport [https://github.com/kraj/crash/commit/4ee56105881d7bb1da1e668ac5bb47a4e0846676]
35Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
36---
37 defs.h | 2 +-
38 tools.c | 2 +-
39 2 files changed, 2 insertions(+), 2 deletions(-)
40
41diff --git a/defs.h b/defs.h
42index 8f7d1fa..26afe23 100644
43--- a/defs.h
44+++ b/defs.h
45@@ -5553,7 +5553,7 @@ uint32_t swap32(uint32_t, int);
46 uint64_t swap64(uint64_t, int);
47 ulong *get_cpumask_buf(void);
48 int make_cpumask(char *, ulong *, int, int *);
49-size_t strlcpy(char *, char *, size_t);
50+size_t strlcpy(char *, const char *, size_t) __attribute__ ((__weak__));
51 struct rb_node *rb_first(struct rb_root *);
52 struct rb_node *rb_parent(struct rb_node *, struct rb_node *);
53 struct rb_node *rb_right(struct rb_node *, struct rb_node *);
54diff --git a/tools.c b/tools.c
55index 392a797..0f2db10 100644
56--- a/tools.c
57+++ b/tools.c
58@@ -6795,7 +6795,7 @@ make_cpumask_error:
59 * always be NULL-terminated.
60 */
61 size_t
62-strlcpy(char *dest, char *src, size_t size)
63+strlcpy(char *dest, const char *src, size_t size)
64 {
65 size_t ret = strlen(src);
66
67--
682.41.0
69
diff --git a/meta-oe/recipes-kernel/crash/crash_8.0.2.bb b/meta-oe/recipes-kernel/crash/crash_8.0.2.bb
index f58bb6ef5..f8a460b8c 100644
--- a/meta-oe/recipes-kernel/crash/crash_8.0.2.bb
+++ b/meta-oe/recipes-kernel/crash/crash_8.0.2.bb
@@ -20,6 +20,7 @@ SRC_URI = "git://github.com/crash-utility/${BPN}.git;branch=master;protocol=http
20 file://0001-cross_add_configure_option.patch \ 20 file://0001-cross_add_configure_option.patch \
21 file://donnot-extract-gdb-during-do-compile.patch \ 21 file://donnot-extract-gdb-during-do-compile.patch \
22 file://gdb_build_jobs_and_not_write_crash_target.patch \ 22 file://gdb_build_jobs_and_not_write_crash_target.patch \
23 file://0001-make-src-string-const-in-strlcpy.patch \
23 " 24 "
24SRCREV = "f1cd581d1c4afa5b8ffdfaa6a3ea9f545fe4ec91" 25SRCREV = "f1cd581d1c4afa5b8ffdfaa6a3ea9f545fe4ec91"
25 26