diff options
Diffstat (limited to 'meta/recipes-support/libunwind/libunwind')
9 files changed, 194 insertions, 285 deletions
diff --git a/meta/recipes-support/libunwind/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch b/meta/recipes-support/libunwind/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch deleted file mode 100644 index 437b878365..0000000000 --- a/meta/recipes-support/libunwind/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | From 599f10ac3a24e419a93f97fddbe14de01b1185ea Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
3 | Date: Tue, 13 May 2014 23:32:27 +0200 | ||
4 | Subject: [PATCH 1/6] Add AO_REQUIRE_CAS to fix build on ARM < v6 | ||
5 | |||
6 | ARM earlier than ARMv6, such as ARMv4 and ARMv5 do not provide | ||
7 | optimize atomic operations in libatomic_ops. Since libunwind is using | ||
8 | such operations, it should define AO_REQUIRE_CAS before including | ||
9 | <atomic_ops.h> so that libatomic_ops knows it should use emulated | ||
10 | atomic operations instead (even though they are obviously a lot more | ||
11 | expensive). | ||
12 | |||
13 | Also, while real atomic operations are all inline functions and | ||
14 | therefore linking against libatomic_ops was not required, the emulated | ||
15 | atomic operations actually require linking against libatomic_ops, so | ||
16 | the commented AC_CHECK_LIB test in acinclude.m4 is uncommented to make | ||
17 | sure we link against libatomic_ops. | ||
18 | |||
19 | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
20 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
21 | |||
22 | Upstream-Status: Pending | ||
23 | Taken from: | ||
24 | https://raw.githubusercontent.com/rdnetto/teapot-buildroot/master/package/libunwind/libunwind-02-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch | ||
25 | |||
26 | --- | ||
27 | acinclude.m4 | 8 +------- | ||
28 | include/libunwind_i.h | 1 + | ||
29 | 2 files changed, 2 insertions(+), 7 deletions(-) | ||
30 | |||
31 | diff --git a/acinclude.m4 b/acinclude.m4 | ||
32 | index 497f7c2..9c15af1 100644 | ||
33 | --- a/acinclude.m4 | ||
34 | +++ b/acinclude.m4 | ||
35 | @@ -22,11 +22,5 @@ fi]) | ||
36 | AC_DEFUN([CHECK_ATOMIC_OPS], | ||
37 | [dnl Check whether the system has the atomic_ops package installed. | ||
38 | AC_CHECK_HEADERS(atomic_ops.h) | ||
39 | -# | ||
40 | -# Don't link against libatomic_ops for now. We don't want libunwind | ||
41 | -# to depend on libatomic_ops.so. Fortunately, none of the platforms | ||
42 | -# we care about so far need libatomic_ops.a (everything is done via | ||
43 | -# inline macros). | ||
44 | -# | ||
45 | -# AC_CHECK_LIB(atomic_ops, main) | ||
46 | + AC_CHECK_LIB(atomic_ops, main) | ||
47 | ]) | ||
48 | diff --git a/include/libunwind_i.h b/include/libunwind_i.h | ||
49 | index 36cf7a1..33b4ca3 100644 | ||
50 | --- a/include/libunwind_i.h | ||
51 | +++ b/include/libunwind_i.h | ||
52 | @@ -124,6 +124,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
53 | (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0) | ||
54 | |||
55 | #ifdef HAVE_ATOMIC_OPS_H | ||
56 | +# define AO_REQUIRE_CAS | ||
57 | # include <atomic_ops.h> | ||
58 | static inline int | ||
59 | cmpxchg_ptr (void *addr, void *old, void *new) | ||
60 | -- | ||
61 | 2.20.1 | ||
62 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch b/meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch new file mode 100644 index 0000000000..5840c2b4f6 --- /dev/null +++ b/meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 9b27fa9bcd5cadd4c841c42710f41a090377e531 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@arm.com> | ||
3 | Date: Fri, 24 Mar 2023 16:18:44 +0000 | ||
4 | Subject: [PATCH] src/Gtrace: remove unguarded print() calls | ||
5 | |||
6 | There is a use of printf() without #include stdio.h in src/arm/Gtrace.c, | ||
7 | which results in a compiler error if clang 16 is used: | ||
8 | |||
9 | src/arm/Gtrace.c:529:7: error: call to undeclared library function | ||
10 | 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not | ||
11 | support implicit function declarations [-Wimplicit-function-declaration] | ||
12 | |||
13 | Replace the printf("XXX") with a Dprintf, so it doesn't pull stdio in | ||
14 | unless in a debug build, and reword the message to be clearer. | ||
15 | |||
16 | Also there is another printf("XXX") inside a FreeBSD-specific block in | ||
17 | the UNW_ARM_FRAME_SIGRETURN case, replace this with a #error as the code | ||
18 | needs to be implemented. | ||
19 | |||
20 | Fixes #482. | ||
21 | |||
22 | Upstream-Status: Backport [9b27fa9bcd5cadd4c841c42710f41a090377e531] | ||
23 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
24 | --- | ||
25 | src/arm/Gtrace.c | 4 ++-- | ||
26 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/src/arm/Gtrace.c b/src/arm/Gtrace.c | ||
29 | index 51fc281d..9e0f25af 100644 | ||
30 | --- a/src/arm/Gtrace.c | ||
31 | +++ b/src/arm/Gtrace.c | ||
32 | @@ -514,7 +514,7 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size) | ||
33 | if (likely(ret >= 0)) | ||
34 | ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_LR_OFF, lr); | ||
35 | #elif defined(__FreeBSD__) | ||
36 | - printf("XXX\n"); | ||
37 | + #error implement UNW_ARM_FRAME_SIGRETURN on FreeBSD | ||
38 | #endif | ||
39 | |||
40 | /* Resume stack at signal restoration point. The stack is not | ||
41 | @@ -526,7 +526,7 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size) | ||
42 | break; | ||
43 | |||
44 | case UNW_ARM_FRAME_SYSCALL: | ||
45 | - printf("XXX1\n"); | ||
46 | + Dprintf ("%s: implement me\n", __FUNCTION__); | ||
47 | break; | ||
48 | |||
49 | default: | ||
50 | -- | ||
51 | 2.34.1 | ||
52 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/0003-x86-Stub-out-x86_local_resume.patch b/meta/recipes-support/libunwind/libunwind/0003-x86-Stub-out-x86_local_resume.patch deleted file mode 100644 index 508ed6af38..0000000000 --- a/meta/recipes-support/libunwind/libunwind/0003-x86-Stub-out-x86_local_resume.patch +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | From f6866b9e4a6341c50eb1d923dbf48eca2ca40140 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 22 Mar 2016 16:19:29 +0000 | ||
4 | Subject: [PATCH 3/6] x86: Stub out x86_local_resume() | ||
5 | |||
6 | its purpose seems | ||
7 | to be unwinding across signal handler boundaries, which cannot happen | ||
8 | in correct programs anyway. Replacing the whole function with | ||
9 | something like *(volatile char *)0=0; (i.e. crash), gets a working | ||
10 | libunwind | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | |||
15 | --- | ||
16 | src/x86/Gos-linux.c | 22 +--------------------- | ||
17 | 1 file changed, 1 insertion(+), 21 deletions(-) | ||
18 | |||
19 | diff --git a/src/x86/Gos-linux.c b/src/x86/Gos-linux.c | ||
20 | index fb9a5e3..c25ae0c 100644 | ||
21 | --- a/src/x86/Gos-linux.c | ||
22 | +++ b/src/x86/Gos-linux.c | ||
23 | @@ -284,27 +284,7 @@ x86_r_uc_addr (ucontext_t *uc, int reg) | ||
24 | HIDDEN int | ||
25 | x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) | ||
26 | { | ||
27 | - struct cursor *c = (struct cursor *) cursor; | ||
28 | - ucontext_t *uc = c->uc; | ||
29 | - | ||
30 | - /* Ensure c->pi is up-to-date. On x86, it's relatively common to be | ||
31 | - missing DWARF unwind info. We don't want to fail in that case, | ||
32 | - because the frame-chain still would let us do a backtrace at | ||
33 | - least. */ | ||
34 | - dwarf_make_proc_info (&c->dwarf); | ||
35 | - | ||
36 | - if (unlikely (c->sigcontext_format != X86_SCF_NONE)) | ||
37 | - { | ||
38 | - struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; | ||
39 | - | ||
40 | - Debug (8, "resuming at ip=%x via sigreturn(%p)\n", c->dwarf.ip, sc); | ||
41 | - x86_sigreturn (sc); | ||
42 | - } | ||
43 | - else | ||
44 | - { | ||
45 | - Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip); | ||
46 | - setcontext (uc); | ||
47 | - } | ||
48 | + *(volatile char *)0=0; | ||
49 | return -UNW_EINVAL; | ||
50 | } | ||
51 | |||
52 | -- | ||
53 | 2.20.1 | ||
54 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/0004-Fix-build-on-mips-musl.patch b/meta/recipes-support/libunwind/libunwind/0004-Fix-build-on-mips-musl.patch deleted file mode 100644 index 124d0e00b1..0000000000 --- a/meta/recipes-support/libunwind/libunwind/0004-Fix-build-on-mips-musl.patch +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | From 6bdab5cc8f1e2ec5f84fc9f59f1699a726980709 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 23 Mar 2016 06:08:59 +0000 | ||
4 | Subject: [PATCH 4/6] Fix build on mips/musl | ||
5 | |||
6 | Do not include endian.h on musl it includes | ||
7 | further headers which can not be compiled in __ASSEMBLER__ | ||
8 | mode | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | |||
13 | --- | ||
14 | src/coredump/_UCD_internal.h | 35 +++++++++++++++++++++++++++++++++++ | ||
15 | src/mips/getcontext.S | 3 +-- | ||
16 | 2 files changed, 36 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/src/coredump/_UCD_internal.h b/src/coredump/_UCD_internal.h | ||
19 | index 3c95a2a..21ed1c3 100644 | ||
20 | --- a/src/coredump/_UCD_internal.h | ||
21 | +++ b/src/coredump/_UCD_internal.h | ||
22 | @@ -44,6 +44,41 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
23 | |||
24 | #include "libunwind_i.h" | ||
25 | |||
26 | +#ifndef __GLIBC__ | ||
27 | +#include <sys/reg.h> | ||
28 | + | ||
29 | +#define EF_REG0 6 | ||
30 | +#define EF_REG1 7 | ||
31 | +#define EF_REG2 8 | ||
32 | +#define EF_REG3 9 | ||
33 | +#define EF_REG4 10 | ||
34 | +#define EF_REG5 11 | ||
35 | +#define EF_REG6 12 | ||
36 | +#define EF_REG7 13 | ||
37 | +#define EF_REG8 14 | ||
38 | +#define EF_REG9 15 | ||
39 | +#define EF_REG10 16 | ||
40 | +#define EF_REG11 17 | ||
41 | +#define EF_REG12 18 | ||
42 | +#define EF_REG13 19 | ||
43 | +#define EF_REG14 20 | ||
44 | +#define EF_REG15 21 | ||
45 | +#define EF_REG16 22 | ||
46 | +#define EF_REG17 23 | ||
47 | +#define EF_REG18 24 | ||
48 | +#define EF_REG19 25 | ||
49 | +#define EF_REG20 26 | ||
50 | +#define EF_REG21 27 | ||
51 | +#define EF_REG22 28 | ||
52 | +#define EF_REG23 29 | ||
53 | +#define EF_REG24 30 | ||
54 | +#define EF_REG25 31 | ||
55 | +#define EF_REG28 34 | ||
56 | +#define EF_REG29 35 | ||
57 | +#define EF_REG30 36 | ||
58 | +#define EF_REG31 37 | ||
59 | +#endif | ||
60 | + | ||
61 | |||
62 | #if SIZEOF_OFF_T == 4 | ||
63 | typedef uint32_t uoff_t; | ||
64 | diff --git a/src/mips/getcontext.S b/src/mips/getcontext.S | ||
65 | index d1dbd57..de9b681 100644 | ||
66 | --- a/src/mips/getcontext.S | ||
67 | +++ b/src/mips/getcontext.S | ||
68 | @@ -24,12 +24,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
69 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
70 | |||
71 | #include "offsets.h" | ||
72 | -#include <endian.h> | ||
73 | |||
74 | .text | ||
75 | |||
76 | #if _MIPS_SIM == _ABIO32 | ||
77 | -# if __BYTE_ORDER == __BIG_ENDIAN | ||
78 | +# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | ||
79 | # define OFFSET 4 | ||
80 | # else | ||
81 | # define OFFSET 0 | ||
82 | -- | ||
83 | 2.20.1 | ||
84 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch b/meta/recipes-support/libunwind/libunwind/0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch index edaa822be1..e58a71b741 100644 --- a/meta/recipes-support/libunwind/libunwind/0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch +++ b/meta/recipes-support/libunwind/libunwind/0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch | |||
@@ -1,7 +1,8 @@ | |||
1 | From 02919d74b1599979884f9cee466ed392d9fc4819 Mon Sep 17 00:00:00 2001 | 1 | From 24c751f9d21e892a9833e1b70a696b07872b0f7f Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sat, 9 Jul 2016 01:07:53 +0000 | 3 | Date: Sat, 9 Jul 2016 01:07:53 +0000 |
4 | Subject: [PATCH 5/6] ppc32: Consider ucontext mismatches between glibc and | 4 | Subject: [PATCH] ppc32: Consider ucontext mismatches between glibc and |
5 | |||
5 | musl | 6 | musl |
6 | 7 | ||
7 | This helps in porting libunwind onto musl based systems | 8 | This helps in porting libunwind onto musl based systems |
@@ -29,7 +30,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
29 | 3 files changed, 92 insertions(+), 79 deletions(-) | 30 | 3 files changed, 92 insertions(+), 79 deletions(-) |
30 | 31 | ||
31 | diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c | 32 | diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c |
32 | index ba30244..c5312d9 100644 | 33 | index 7b45455..f8d6886 100644 |
33 | --- a/src/ppc32/Ginit.c | 34 | --- a/src/ppc32/Ginit.c |
34 | +++ b/src/ppc32/Ginit.c | 35 | +++ b/src/ppc32/Ginit.c |
35 | @@ -48,12 +48,12 @@ uc_addr (ucontext_t *uc, int reg) | 36 | @@ -48,12 +48,12 @@ uc_addr (ucontext_t *uc, int reg) |
@@ -227,7 +228,7 @@ index c6ba806..b79f15c 100644 | |||
227 | 228 | ||
228 | #endif | 229 | #endif |
229 | diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c | 230 | diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c |
230 | index c82d1c9..6c31baa 100644 | 231 | index b7dd3b7..bfaf756 100644 |
231 | --- a/src/ptrace/_UPT_reg_offset.c | 232 | --- a/src/ptrace/_UPT_reg_offset.c |
232 | +++ b/src/ptrace/_UPT_reg_offset.c | 233 | +++ b/src/ptrace/_UPT_reg_offset.c |
233 | @@ -27,6 +27,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | 234 | @@ -27,6 +27,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
@@ -242,8 +243,5 @@ index c82d1c9..6c31baa 100644 | |||
242 | +# undef pt_regs | 243 | +# undef pt_regs |
243 | +#endif | 244 | +#endif |
244 | 245 | ||
245 | #ifdef HAVE_ASM_PTRACE_OFFSETS_H | 246 | #ifdef HAVE_ASM_PTRACE_H |
246 | # include <asm/ptrace_offsets.h> | 247 | # include <asm/ptrace.h> |
247 | -- | ||
248 | 2.20.1 | ||
249 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/0006-Fix-for-X32.patch b/meta/recipes-support/libunwind/libunwind/0006-Fix-for-X32.patch deleted file mode 100644 index 37ae8124cc..0000000000 --- a/meta/recipes-support/libunwind/libunwind/0006-Fix-for-X32.patch +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | From 7a4fd5933cc795df85cdd85168fe54fbaec4dcec Mon Sep 17 00:00:00 2001 | ||
2 | From: Christopher Larson <chris_larson@mentor.com> | ||
3 | Date: Tue, 13 Dec 2016 09:50:34 -0700 | ||
4 | Subject: [PATCH 6/6] Fix for X32 | ||
5 | |||
6 | Apply patch to fix the X32 build from https://github.com/sjnewbury/x32. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | Signed-off-by: Christopher Larson <chris_larson@mentor.com> | ||
10 | |||
11 | --- | ||
12 | src/x86_64/Gos-linux.c | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/src/x86_64/Gos-linux.c b/src/x86_64/Gos-linux.c | ||
16 | index bd14234..be1cb5b 100644 | ||
17 | --- a/src/x86_64/Gos-linux.c | ||
18 | +++ b/src/x86_64/Gos-linux.c | ||
19 | @@ -145,8 +145,8 @@ x86_64_sigreturn (unw_cursor_t *cursor) | ||
20 | |||
21 | Debug (8, "resuming at ip=%llx via sigreturn(%p)\n", | ||
22 | (unsigned long long) c->dwarf.ip, sc); | ||
23 | - __asm__ __volatile__ ("mov %0, %%rsp;" | ||
24 | - "mov %1, %%rax;" | ||
25 | + __asm__ __volatile__ ("mov %q0, %%rsp;" | ||
26 | + "mov %q1, %%rax;" | ||
27 | "syscall" | ||
28 | :: "r"(sc), "i"(SYS_rt_sigreturn) | ||
29 | : "memory"); | ||
30 | -- | ||
31 | 2.20.1 | ||
32 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/mips-byte-order.patch b/meta/recipes-support/libunwind/libunwind/mips-byte-order.patch new file mode 100644 index 0000000000..8848780fd1 --- /dev/null +++ b/meta/recipes-support/libunwind/libunwind/mips-byte-order.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From dbbf8110ed3fd2cbac20a8ec2ac769e13c67bab1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@arm.com> | ||
3 | Date: Tue, 16 Jan 2024 18:22:38 +0000 | ||
4 | Subject: [PATCH 2/2] byte order | ||
5 | |||
6 | endian.h on musl/mips can't be included in __ASSEMBLER__ mode, | ||
7 | so use the __BYTE_ORDER__ symbol instead. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
11 | --- | ||
12 | src/mips/getcontext.S | 3 +-- | ||
13 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/src/mips/getcontext.S b/src/mips/getcontext.S | ||
16 | index d1dbd579..de9b6818 100644 | ||
17 | --- a/src/mips/getcontext.S | ||
18 | +++ b/src/mips/getcontext.S | ||
19 | @@ -24,12 +24,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
21 | |||
22 | #include "offsets.h" | ||
23 | -#include <endian.h> | ||
24 | |||
25 | .text | ||
26 | |||
27 | #if _MIPS_SIM == _ABIO32 | ||
28 | -# if __BYTE_ORDER == __BIG_ENDIAN | ||
29 | +# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | ||
30 | # define OFFSET 4 | ||
31 | # else | ||
32 | # define OFFSET 0 | ||
33 | -- | ||
34 | 2.34.1 | ||
35 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch b/meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch new file mode 100644 index 0000000000..68adcd1d71 --- /dev/null +++ b/meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch | |||
@@ -0,0 +1,100 @@ | |||
1 | From 7750e2a29b084ee033acc82abab410035e220d3f Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@arm.com> | ||
3 | Date: Tue, 16 Jan 2024 18:21:26 +0000 | ||
4 | Subject: [PATCH 1/2] coredump-mips-register | ||
5 | |||
6 | glibc and musl have different names for the registers, add a | ||
7 | macro that generates the names appropriately. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
11 | |||
12 | --- | ||
13 | src/coredump/_UCD_access_reg_linux.c | 69 ++++++++++++++++------------ | ||
14 | 1 file changed, 39 insertions(+), 30 deletions(-) | ||
15 | |||
16 | diff --git a/src/coredump/_UCD_access_reg_linux.c b/src/coredump/_UCD_access_reg_linux.c | ||
17 | index 27eef123..beefdb47 100644 | ||
18 | --- a/src/coredump/_UCD_access_reg_linux.c | ||
19 | +++ b/src/coredump/_UCD_access_reg_linux.c | ||
20 | @@ -67,38 +67,47 @@ _UCD_access_reg (unw_addr_space_t as, | ||
21 | goto badreg; | ||
22 | #else | ||
23 | #if defined(UNW_TARGET_MIPS) | ||
24 | + | ||
25 | +/* glibc and musl use different names */ | ||
26 | +#ifdef __GLIBC__ | ||
27 | +#define EF_REG(x) EF_REG ## x | ||
28 | +#else | ||
29 | +#include <sys/reg.h> | ||
30 | +#define EF_REG(x) EF_R ## x | ||
31 | +#endif | ||
32 | + | ||
33 | static const uint8_t remap_regs[] = | ||
34 | { | ||
35 | - [UNW_MIPS_R0] = EF_REG0, | ||
36 | - [UNW_MIPS_R1] = EF_REG1, | ||
37 | - [UNW_MIPS_R2] = EF_REG2, | ||
38 | - [UNW_MIPS_R3] = EF_REG3, | ||
39 | - [UNW_MIPS_R4] = EF_REG4, | ||
40 | - [UNW_MIPS_R5] = EF_REG5, | ||
41 | - [UNW_MIPS_R6] = EF_REG6, | ||
42 | - [UNW_MIPS_R7] = EF_REG7, | ||
43 | - [UNW_MIPS_R8] = EF_REG8, | ||
44 | - [UNW_MIPS_R9] = EF_REG9, | ||
45 | - [UNW_MIPS_R10] = EF_REG10, | ||
46 | - [UNW_MIPS_R11] = EF_REG11, | ||
47 | - [UNW_MIPS_R12] = EF_REG12, | ||
48 | - [UNW_MIPS_R13] = EF_REG13, | ||
49 | - [UNW_MIPS_R14] = EF_REG14, | ||
50 | - [UNW_MIPS_R15] = EF_REG15, | ||
51 | - [UNW_MIPS_R16] = EF_REG16, | ||
52 | - [UNW_MIPS_R17] = EF_REG17, | ||
53 | - [UNW_MIPS_R18] = EF_REG18, | ||
54 | - [UNW_MIPS_R19] = EF_REG19, | ||
55 | - [UNW_MIPS_R20] = EF_REG20, | ||
56 | - [UNW_MIPS_R21] = EF_REG21, | ||
57 | - [UNW_MIPS_R22] = EF_REG22, | ||
58 | - [UNW_MIPS_R23] = EF_REG23, | ||
59 | - [UNW_MIPS_R24] = EF_REG24, | ||
60 | - [UNW_MIPS_R25] = EF_REG25, | ||
61 | - [UNW_MIPS_R28] = EF_REG28, | ||
62 | - [UNW_MIPS_R29] = EF_REG29, | ||
63 | - [UNW_MIPS_R30] = EF_REG30, | ||
64 | - [UNW_MIPS_R31] = EF_REG31, | ||
65 | + [UNW_MIPS_R0] = EF_REG(0), | ||
66 | + [UNW_MIPS_R1] = EF_REG(1), | ||
67 | + [UNW_MIPS_R2] = EF_REG(2), | ||
68 | + [UNW_MIPS_R3] = EF_REG(3), | ||
69 | + [UNW_MIPS_R4] = EF_REG(4), | ||
70 | + [UNW_MIPS_R5] = EF_REG(5), | ||
71 | + [UNW_MIPS_R6] = EF_REG(6), | ||
72 | + [UNW_MIPS_R7] = EF_REG(7), | ||
73 | + [UNW_MIPS_R8] = EF_REG(8), | ||
74 | + [UNW_MIPS_R9] = EF_REG(9), | ||
75 | + [UNW_MIPS_R10] = EF_REG(10), | ||
76 | + [UNW_MIPS_R11] = EF_REG(11), | ||
77 | + [UNW_MIPS_R12] = EF_REG(12), | ||
78 | + [UNW_MIPS_R13] = EF_REG(13), | ||
79 | + [UNW_MIPS_R14] = EF_REG(14), | ||
80 | + [UNW_MIPS_R15] = EF_REG(15), | ||
81 | + [UNW_MIPS_R16] = EF_REG(16), | ||
82 | + [UNW_MIPS_R17] = EF_REG(17), | ||
83 | + [UNW_MIPS_R18] = EF_REG(18), | ||
84 | + [UNW_MIPS_R19] = EF_REG(19), | ||
85 | + [UNW_MIPS_R20] = EF_REG(20), | ||
86 | + [UNW_MIPS_R21] = EF_REG(21), | ||
87 | + [UNW_MIPS_R22] = EF_REG(22), | ||
88 | + [UNW_MIPS_R23] = EF_REG(23), | ||
89 | + [UNW_MIPS_R24] = EF_REG(24), | ||
90 | + [UNW_MIPS_R25] = EF_REG(25), | ||
91 | + [UNW_MIPS_R28] = EF_REG(28), | ||
92 | + [UNW_MIPS_R29] = EF_REG(29), | ||
93 | + [UNW_MIPS_R30] = EF_REG(30), | ||
94 | + [UNW_MIPS_R31] = EF_REG(31), | ||
95 | [UNW_MIPS_PC] = EF_CP0_EPC, | ||
96 | }; | ||
97 | #elif defined(UNW_TARGET_X86) | ||
98 | -- | ||
99 | 2.34.1 | ||
100 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch b/meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch deleted file mode 100644 index 63b78a8a30..0000000000 --- a/meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | From 49b21f0fe5fb93b30b94cc449429fd33de0652a7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Thu, 18 Aug 2016 14:46:32 +0100 | ||
4 | Subject: [PATCH] If you: | ||
5 | |||
6 | TCLIBC=musl bitbake unwind | ||
7 | TCLIBC=musl bitbake gcc-runtime -c cleansstate | ||
8 | TCLIBC=musl bitbake gcc-runtime | ||
9 | |||
10 | you will see libstdc++ fail to build due to finding libunwind's header file. | ||
11 | |||
12 | Khem: "When we build any of gcc components they expect to use internal version | ||
13 | and that works with glibc based gcc since the search headers first look into gcc | ||
14 | headers, however with musl the gcc headers are searched after the standard | ||
15 | headers ( which is by design the right thing )." | ||
16 | |||
17 | This patch hacks around the issue by looking for a define used during gcc-runtime's | ||
18 | build and skipping to the internal header in that case. | ||
19 | |||
20 | [YOCTO #10129] | ||
21 | |||
22 | RP 2016/8/18 | ||
23 | |||
24 | Upstream-Status: Inappropriate [really need to fix gcc] | ||
25 | |||
26 | --- | ||
27 | include/unwind.h | 4 ++++ | ||
28 | 1 file changed, 4 insertions(+) | ||
29 | |||
30 | diff --git a/include/unwind.h b/include/unwind.h | ||
31 | index 7cf128d..31c2871 100644 | ||
32 | --- a/include/unwind.h | ||
33 | +++ b/include/unwind.h | ||
34 | @@ -23,6 +23,10 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
35 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
36 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
37 | |||
38 | +#ifdef _GLIBCXX_SHARED | ||
39 | +#include_next <unwind.h> | ||
40 | +#endif | ||
41 | + | ||
42 | #ifndef _UNWIND_H | ||
43 | #define _UNWIND_H | ||
44 | |||