summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-Handle-musl-on-PPC32.patch88
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch52
-rw-r--r--meta/recipes-support/libunwind/libunwind/0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch247
-rw-r--r--meta/recipes-support/libunwind/libunwind/force-enable-man.patch20
-rw-r--r--meta/recipes-support/libunwind/libunwind/linux-musl.patch152
-rw-r--r--meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch13
-rw-r--r--meta/recipes-support/libunwind/libunwind_1.8.0.bb (renamed from meta/recipes-support/libunwind/libunwind_1.6.2.bb)15
7 files changed, 273 insertions, 314 deletions
diff --git a/meta/recipes-support/libunwind/libunwind/0001-Handle-musl-on-PPC32.patch b/meta/recipes-support/libunwind/libunwind/0001-Handle-musl-on-PPC32.patch
new file mode 100644
index 00000000000..8c37d4133b7
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/0001-Handle-musl-on-PPC32.patch
@@ -0,0 +1,88 @@
+From 2e89cbcef884ef1157cf40cbf2fa7db2a027babb Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Wed, 17 Jan 2024 16:28:39 +0000
+Subject: [PATCH] Handle musl on PPC32
+
+On Linux, glibc and musl disagree over the layout of the ucontext_t
+structure. For more details, see the musl mailing list:
+
+https://www.openwall.com/lists/musl/2018/02/22/1
+
+Add conditionals to handle both the glibc and musl layout of the
+structures.
+
+Closes #709.
+
+Upstream-Status: Submitted [https://github.com/libunwind/libunwind/pull/710]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ src/ppc32/Ginit.c | 13 ++++++++++---
+ src/ppc32/ucontext_i.h | 5 +++++
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c
+index 9444cbb8..5e94ed8a 100644
+--- a/src/ppc32/Ginit.c
++++ b/src/ppc32/Ginit.c
+@@ -42,6 +42,13 @@ static struct unw_addr_space local_addr_space;
+
+ unw_addr_space_t unw_local_addr_space = &local_addr_space;
+
++/* glibc and musl disagree over the layout of this struct */
++#ifdef __GLIBC__
++#define _UC_MCONTEXT_REGS(x) x->uc_mcontext.uc_regs
++#else
++#define _UC_MCONTEXT_REGS(x) x->uc_regs
++#endif
++
+ static void *
+ uc_addr (ucontext_t *uc, int reg)
+ {
+@@ -49,7 +56,7 @@ uc_addr (ucontext_t *uc, int reg)
+
+ if ((unsigned) (reg - UNW_PPC32_R0) < 32)
+ #if defined(__linux__)
+- addr = &uc->uc_mcontext.uc_regs->gregs[reg - UNW_PPC32_R0];
++ addr = _UC_MCONTEXT_REGS(&uc)->gregs[reg - UNW_PPC32_R0];
+ #elif defined(__FreeBSD__)
+ addr = &uc->uc_mcontext.mc_gpr[reg - UNW_PPC32_R0];
+ #endif
+@@ -58,7 +65,7 @@ uc_addr (ucontext_t *uc, int reg)
+ if ( ((unsigned) (reg - UNW_PPC32_F0) < 32) &&
+ ((unsigned) (reg - UNW_PPC32_F0) >= 0) )
+ #if defined(__linux__)
+- addr = &uc->uc_mcontext.uc_regs->fpregs.fpregs[reg - UNW_PPC32_F0];
++ addr = _UC_MCONTEXT_REGS(&uc)->fpregs.fpregs[reg - UNW_PPC32_F0];
+ #elif defined(__FreeBSD__)
+ addr = &uc->uc_mcontext.mc_fpreg[reg - UNW_PPC32_F0];
+ #endif
+@@ -85,7 +92,7 @@ uc_addr (ucontext_t *uc, int reg)
+ return NULL;
+ }
+ #if defined(__linux__)
+- addr = &uc->uc_mcontext.uc_regs->gregs[gregs_idx];
++ addr = _UC_MCONTEXT_REGS(&uc)->gregs[gregs_idx];
+ #elif defined(__FreeBSD__)
+ addr = &uc->uc_mcontext.mc_gpr[gregs_idx];
+ #endif
+diff --git a/src/ppc32/ucontext_i.h b/src/ppc32/ucontext_i.h
+index ee93c697..cfd8fe0e 100644
+--- a/src/ppc32/ucontext_i.h
++++ b/src/ppc32/ucontext_i.h
+@@ -44,8 +44,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+ //#define MQ_IDX 36
+ #define LINK_IDX 36
+
++#ifdef __GLIBC__
+ #define _UC_MCONTEXT_GPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[x] - (void *)&dmy_ctxt) )
+ #define _UC_MCONTEXT_FPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[x] - (void *)&dmy_ctxt) )
++#else
++#define _UC_MCONTEXT_GPR(x) ( ((void *)&dmy_ctxt.uc_regs->gregs[x] - (void *)&dmy_ctxt) )
++#define _UC_MCONTEXT_FPR(x) ( ((void *)&dmy_ctxt.uc_regs->fpregs.fpregs[x] - (void *)&dmy_ctxt) )
++#endif
+
+ /* These are dummy structures used only for obtaining the offsets of the
+ various structure members. */
+--
+2.34.1
+
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
deleted file mode 100644
index 5840c2b4f62..00000000000
--- a/meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 9b27fa9bcd5cadd4c841c42710f41a090377e531 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@arm.com>
-Date: Fri, 24 Mar 2023 16:18:44 +0000
-Subject: [PATCH] src/Gtrace: remove unguarded print() calls
-
-There is a use of printf() without #include stdio.h in src/arm/Gtrace.c,
-which results in a compiler error if clang 16 is used:
-
-src/arm/Gtrace.c:529:7: error: call to undeclared library function
-'printf' with type 'int (const char *, ...)'; ISO C99 and later do not
-support implicit function declarations [-Wimplicit-function-declaration]
-
-Replace the printf("XXX") with a Dprintf, so it doesn't pull stdio in
-unless in a debug build, and reword the message to be clearer.
-
-Also there is another printf("XXX") inside a FreeBSD-specific block in
-the UNW_ARM_FRAME_SIGRETURN case, replace this with a #error as the code
-needs to be implemented.
-
-Fixes #482.
-
-Upstream-Status: Backport [9b27fa9bcd5cadd4c841c42710f41a090377e531]
-Signed-off-by: Ross Burton <ross.burton@arm.com>
----
- src/arm/Gtrace.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/arm/Gtrace.c b/src/arm/Gtrace.c
-index 51fc281d..9e0f25af 100644
---- a/src/arm/Gtrace.c
-+++ b/src/arm/Gtrace.c
-@@ -514,7 +514,7 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size)
- if (likely(ret >= 0))
- ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_LR_OFF, lr);
- #elif defined(__FreeBSD__)
-- printf("XXX\n");
-+ #error implement UNW_ARM_FRAME_SIGRETURN on FreeBSD
- #endif
-
- /* Resume stack at signal restoration point. The stack is not
-@@ -526,7 +526,7 @@ tdep_trace (unw_cursor_t *cursor, void **buffer, int *size)
- break;
-
- case UNW_ARM_FRAME_SYSCALL:
-- printf("XXX1\n");
-+ Dprintf ("%s: implement me\n", __FUNCTION__);
- break;
-
- default:
---
-2.34.1
-
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
deleted file mode 100644
index e58a71b741b..00000000000
--- a/meta/recipes-support/libunwind/libunwind/0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-From 24c751f9d21e892a9833e1b70a696b07872b0f7f Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 9 Jul 2016 01:07:53 +0000
-Subject: [PATCH] ppc32: Consider ucontext mismatches between glibc and
-
- musl
-
-This helps in porting libunwind onto musl based systems
-ptrace.h change is required again an error that surfaces
-with musl
-
-/mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/asm/ptrace.h:31:8: error: redefinition of 'struct pt_regs'
- struct pt_regs {
- ^~~~~~~
-In file included from /mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/sys/user.h:11:0,
- from /mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/sys/procfs.h:9,
- from ../../git/src/ptrace/_UPT_internal.h:40,
- from ../../git/src/ptrace/_UPT_reg_offset.c:27:
-/mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/bits/user.h:1:8: note: originally defined here
- struct pt_regs {
- ^~~~~~~
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
- src/ppc32/Ginit.c | 6 +-
- src/ppc32/ucontext_i.h | 158 ++++++++++++++++++-----------------
- src/ptrace/_UPT_reg_offset.c | 7 ++
- 3 files changed, 92 insertions(+), 79 deletions(-)
-
-diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c
-index 7b45455..f8d6886 100644
---- a/src/ppc32/Ginit.c
-+++ b/src/ppc32/Ginit.c
-@@ -48,12 +48,12 @@ uc_addr (ucontext_t *uc, int reg)
- void *addr;
-
- if ((unsigned) (reg - UNW_PPC32_R0) < 32)
-- addr = &uc->uc_mcontext.uc_regs->gregs[reg - UNW_PPC32_R0];
-+ addr = &uc->GET_UC_REGS->gregs[reg - UNW_PPC32_R0];
-
- else
- if ( ((unsigned) (reg - UNW_PPC32_F0) < 32) &&
- ((unsigned) (reg - UNW_PPC32_F0) >= 0) )
-- addr = &uc->uc_mcontext.uc_regs->fpregs.fpregs[reg - UNW_PPC32_F0];
-+ addr = &uc->GET_UC_REGS->fpregs.fpregs[reg - UNW_PPC32_F0];
-
- else
- {
-@@ -76,7 +76,7 @@ uc_addr (ucontext_t *uc, int reg)
- default:
- return NULL;
- }
-- addr = &uc->uc_mcontext.uc_regs->gregs[gregs_idx];
-+ addr = &uc->GET_UC_REGS->gregs[gregs_idx];
- }
- return addr;
- }
-diff --git a/src/ppc32/ucontext_i.h b/src/ppc32/ucontext_i.h
-index c6ba806..b79f15c 100644
---- a/src/ppc32/ucontext_i.h
-+++ b/src/ppc32/ucontext_i.h
-@@ -46,83 +46,89 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
- various structure members. */
- static ucontext_t dmy_ctxt UNUSED;
-
--#define UC_MCONTEXT_GREGS_R0 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[0] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R1 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[1] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R2 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[2] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[3] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R4 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[4] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R5 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[5] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R6 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[6] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R7 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[7] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R8 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[8] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R9 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[9] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R10 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[10] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R11 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[11] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R12 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[12] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R13 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[13] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R14 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[14] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R15 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[15] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R16 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[16] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R17 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[17] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R18 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[18] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R19 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[19] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R20 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[20] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R21 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[21] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R22 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[22] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R23 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[23] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R24 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[24] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R25 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[25] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R26 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[26] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R27 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[27] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R28 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[28] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R29 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[29] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R30 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[30] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_R31 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[31] - (void *)&dmy_ctxt)
-+#ifdef __GLIBC__
-+#define GET_UC_REGS uc_mcontext.uc_regs
-+#else
-+#define GET_UC_REGS uc_regs
-+#endif
-+
-+#define UC_MCONTEXT_GREGS_R0 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[0] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R1 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[1] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R2 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[2] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R3 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[3] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R4 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[4] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R5 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[5] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R6 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[6] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R7 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[7] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R8 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[8] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R9 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[9] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R10 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[10] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R11 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[11] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R12 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[12] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R13 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[13] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R14 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[14] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R15 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[15] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R16 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[16] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R17 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[17] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R18 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[18] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R19 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[19] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R20 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[20] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R21 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[21] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R22 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[22] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R23 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[23] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R24 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[24] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R25 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[25] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R26 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[26] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R27 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[27] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R28 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[28] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R29 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[29] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R30 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[30] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_R31 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[31] - (void *)&dmy_ctxt)
-
--#define UC_MCONTEXT_GREGS_MSR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[MSR_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_ORIG_GPR3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[ORIG_GPR3_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_CTR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[CTR_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_LINK ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[LINK_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_XER ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[XER_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_CCR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[CCR_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_SOFTE ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[SOFTE_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_TRAP ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[TRAP_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_DAR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[DAR_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_DSISR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[DSISR_IDX] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_GREGS_RESULT ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[RESULT_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_MSR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[MSR_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_ORIG_GPR3 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[ORIG_GPR3_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_CTR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[CTR_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_LINK ((void *)&dmy_ctxt.GET_UC_REGS->gregs[LINK_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_XER ((void *)&dmy_ctxt.GET_UC_REGS->gregs[XER_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_CCR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[CCR_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_SOFTE ((void *)&dmy_ctxt.GET_UC_REGS->gregs[SOFTE_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_TRAP ((void *)&dmy_ctxt.GET_UC_REGS->gregs[TRAP_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_DAR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[DAR_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_DSISR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[DSISR_IDX] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_GREGS_RESULT ((void *)&dmy_ctxt.GET_UC_REGS->gregs[RESULT_IDX] - (void *)&dmy_ctxt)
-
--#define UC_MCONTEXT_FREGS_R0 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[0] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R1 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[1] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R2 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[2] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[3] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R4 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[4] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R5 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[5] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R6 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[6] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R7 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[7] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R8 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[8] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R9 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[9] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R10 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[10] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R11 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[11] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R12 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[12] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R13 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[13] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R14 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[14] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R15 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[15] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R16 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[16] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R17 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[17] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R18 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[18] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R19 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[19] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R20 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[20] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R21 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[21] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R22 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[22] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R23 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[23] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R24 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[24] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R25 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[25] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R26 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[26] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R27 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[27] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R28 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[28] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R29 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[29] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R30 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[30] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_R31 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[31] - (void *)&dmy_ctxt)
--#define UC_MCONTEXT_FREGS_FPSCR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[32] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R0 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[0] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R1 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[1] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R2 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[2] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R3 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[3] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R4 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[4] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R5 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[5] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R6 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[6] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R7 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[7] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R8 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[8] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R9 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[9] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R10 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[10] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R11 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[11] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R12 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[12] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R13 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[13] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R14 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[14] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R15 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[15] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R16 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[16] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R17 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[17] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R18 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[18] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R19 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[19] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R20 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[20] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R21 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[21] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R22 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[22] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R23 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[23] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R24 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[24] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R25 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[25] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R26 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[26] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R27 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[27] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R28 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[28] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R29 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[29] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R30 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[30] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_R31 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[31] - (void *)&dmy_ctxt)
-+#define UC_MCONTEXT_FREGS_FPSCR ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[32] - (void *)&dmy_ctxt)
-
- #endif
-diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c
-index b7dd3b7..bfaf756 100644
---- a/src/ptrace/_UPT_reg_offset.c
-+++ b/src/ptrace/_UPT_reg_offset.c
-@@ -27,6 +27,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
- #include "_UPT_internal.h"
-
- #include <stddef.h>
-+#if !defined(__GLIBC__)
-+# define pt_regs uapi_pt_regs
-+#endif
-+#include <asm/ptrace.h>
-+#if !defined(__GLIBC__)
-+# undef pt_regs
-+#endif
-
- #ifdef HAVE_ASM_PTRACE_H
- # include <asm/ptrace.h>
diff --git a/meta/recipes-support/libunwind/libunwind/force-enable-man.patch b/meta/recipes-support/libunwind/libunwind/force-enable-man.patch
new file mode 100644
index 00000000000..8591ec07de0
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/force-enable-man.patch
@@ -0,0 +1,20 @@
+Man pages are already built in the release tarball, so we don't
+need latex2man to build the manpages.
+
+Upstream-Status: Submitted [https://github.com/libunwind/libunwind/pull/712]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+--
+diff --git a/configure.ac b/configure.ac
+index 406f3773..7744251b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -297,8 +297,7 @@ AC_ARG_ENABLE([documentation],
+ AC_MSG_RESULT([$enable_documentation])
+ AC_PATH_PROG([LATEX2MAN],[latex2man])
+ AS_IF([test "x$LATEX2MAN" = "x" && test "x$enable_documentation" != "xno"], [
+- AC_MSG_WARN([latex2man not found. Install latex2man. Disabling docs.])
+- enable_documentation="no";
++ AC_MSG_WARN([latex2man not found, unable to regenerate the manpages])
+ ])
+ AM_CONDITIONAL([CONFIG_DOCS], [test x$enable_documentation != xno])
+ AM_COND_IF([CONFIG_DOCS], [AC_CONFIG_FILES([doc/Makefile doc/common.tex])])
diff --git a/meta/recipes-support/libunwind/libunwind/linux-musl.patch b/meta/recipes-support/libunwind/libunwind/linux-musl.patch
new file mode 100644
index 00000000000..f155cafb519
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/linux-musl.patch
@@ -0,0 +1,152 @@
+From 75fe438e4adaa1666b39c4b08e22c1eb947b6986 Mon Sep 17 00:00:00 2001
+From: "Stephen M. Webb" <stephen.webb@bregmasoft.ca>
+Date: Fri, 29 Dec 2023 10:24:03 -0500
+Subject: [PATCH] Add explicit support for linux-musl targets
+
+- added musl target CI builds to CI-unix.yml
+- added config-time check for libucontext
+- added better detection of NULL IP in x86_64 unw_step() because musl does not
+ follow the de facto x86_64 ABI conventions for main program entry
+
+Upstream-Status: Backport [75fe438e4adaa1666b39c4b08e22c1eb947b6986]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ .github/workflows/CI-unix.yml | 66 ++++++++++++++++++++++++++++++++---
+ configure.ac | 1 +
+ src/x86_64/Gstep.c | 63 ++++++++++++++++++++-------------
+ 3 files changed, 101 insertions(+), 29 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8cde58af..406f3773 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,6 +64,7 @@ AC_SEARCH_LIBS([_Unwind_Resume], [gcc_s gcc],
+ LIBS="$save_LIBS"
+ LDFLAGS="$save_LDFLAGS"
+ AC_SEARCH_LIBS([__uc_get_grs], [uca])
++AC_SEARCH_LIBS([getcontext], [ucontext])
+
+ dnl Checks for library functions.
+ AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \
+diff --git a/src/x86_64/Gstep.c b/src/x86_64/Gstep.c
+index 72ebbd96..1c33e149 100644
+--- a/src/x86_64/Gstep.c
++++ b/src/x86_64/Gstep.c
+@@ -111,7 +111,8 @@ unw_step (unw_cursor_t *cursor)
+ code. */
+
+ unw_word_t invalid_prev_rip = 0;
+- unw_word_t prev_ip = c->dwarf.ip, prev_cfa = c->dwarf.cfa;
++ unw_word_t prev_ip = c->dwarf.ip;
++ unw_word_t prev_cfa = c->dwarf.cfa;
+ struct dwarf_loc rbp_loc = DWARF_NULL_LOC, rsp_loc = DWARF_NULL_LOC, rip_loc = DWARF_NULL_LOC;
+
+ /* We could get here because of missing/bad unwind information.
+@@ -149,8 +150,9 @@ unw_step (unw_cursor_t *cursor)
+ c->dwarf.loc[RIP] = DWARF_LOC (c->dwarf.cfa, 0);
+ c->dwarf.cfa += 8;
+ }
+- else if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP]))
++ else if (prev_ip == 0 || (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP])))
+ {
++ Debug (2, "End of call chain detected\n");
+ for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i)
+ c->dwarf.loc[i] = DWARF_NULL_LOC;
+ }
+@@ -167,7 +169,7 @@ unw_step (unw_cursor_t *cursor)
+ }
+
+ unw_word_t not_used;
+- invalid_prev_rip = dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, prev_ip), &not_used);
++ invalid_prev_rip = dwarf_get (&c->dwarf, DWARF_MEM_LOC (c->dwarf, prev_ip), &not_used);
+
+ if (!rbp && invalid_prev_rip == 0)
+ {
+@@ -187,43 +189,55 @@ unw_step (unw_cursor_t *cursor)
+ int rip_fixup_success = 0;
+ if (invalid_prev_rip != 0)
+ {
+- Debug (2, "Previous RIP 0x%lx was invalid, attempting fixup\n", prev_ip);
++ Debug (2, "Previous RIP %#010lx was invalid, attempting fixup\n", prev_ip);
+ unw_word_t rsp;
+ ret = dwarf_get (&c->dwarf, c->dwarf.loc[RSP], &rsp);
++ Debug (2, "get rsp %#010lx returned %d\n", rsp, ret);
+
+ /*Test to see if what we think is the previous RIP is valid*/
+ unw_word_t new_ip = 0;
+ if (dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, rsp), &new_ip) == 0)
+ {
+- Debug (2, "RSP 0x%lx looks valid\n", rsp);
+- if ((ret = dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, new_ip), &not_used)) == 0)
++ Debug (2, "RSP %#010lx (%#010lx) looks valid\n", rsp, new_ip);
++ if (new_ip == 0x00000000)
+ {
+- Debug (2, "new_ip 0x%lx looks valid\n", new_ip);
++ Debug (2, "End of call chain detected\n");
+ rip_fixup_success = 1;
+- c->frame_info.cfa_reg_offset = 8;
+- c->frame_info.cfa_reg_rsp = -1;
+- c->frame_info.rbp_cfa_offset = -1;
+- c->frame_info.rsp_cfa_offset = -1;
+- c->frame_info.frame_type = UNW_X86_64_FRAME_OTHER;
+- /*
+- * The call should have pushed RIP to the stack
+- * and since there was no preamble RSP hasn't been
+- * touched so RIP should be at RSP.
+- */
+- c->dwarf.cfa += 8;
+- /* Optimised x64 binaries don't use RBP it seems? */
+- rbp_loc = c->dwarf.loc[RBP];
+- rsp_loc = DWARF_VAL_LOC (c, rsp + 8);
+- rip_loc = DWARF_LOC (rsp, 0);
++ rbp_loc = DWARF_NULL_LOC;
++ rsp_loc = DWARF_NULL_LOC;
++ rip_loc = DWARF_NULL_LOC;
+ }
+ else
+ {
+- Debug (2, "new_ip 0x%lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, new_ip), &not_used) != 0\n", new_ip);
++ if ((ret = dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, new_ip), &not_used)) == 0)
++ {
++ Debug (2, "new_ip %#010lx looks valid\n", new_ip);
++ rip_fixup_success = 1;
++ c->frame_info.cfa_reg_offset = 8;
++ c->frame_info.cfa_reg_rsp = -1;
++ c->frame_info.rbp_cfa_offset = -1;
++ c->frame_info.rsp_cfa_offset = -1;
++ c->frame_info.frame_type = UNW_X86_64_FRAME_OTHER;
++ /*
++ * The call should have pushed RIP to the stack
++ * and since there was no preamble RSP hasn't been
++ * touched so RIP should be at RSP.
++ */
++ c->dwarf.cfa += 8;
++ /* Optimised x64 binaries don't use RBP it seems? */
++ rbp_loc = c->dwarf.loc[RBP];
++ rsp_loc = DWARF_VAL_LOC (c, rsp + 8);
++ rip_loc = DWARF_LOC (rsp, 0);
++ }
++ else
++ {
++ Debug (2, "new_ip %#010lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, new_ip_addr), &new_ip) != 0\n", new_ip);
++ }
+ }
+ }
+ else
+ {
+- Debug (2, "rsp 0x%lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, rsp), &new_ip) != 0\n", rsp);
++ Debug (2, "rsp %#010lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, rsp), &new_ip_addr) != 0\n", rsp);
+ }
+ }
+ /*
+@@ -260,7 +274,6 @@ unw_step (unw_cursor_t *cursor)
+ c->frame_info.cfa_reg_offset = 16;
+ c->frame_info.rbp_cfa_offset = -16;
+ c->dwarf.cfa += 16;
+-
+ }
+ }
+ /* Mark all registers unsaved */
+--
+2.34.1
+
diff --git a/meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch b/meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch
index 68adcd1d712..ae70ad1286d 100644
--- a/meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch
+++ b/meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch
@@ -6,7 +6,7 @@ Subject: [PATCH 1/2] coredump-mips-register
glibc and musl have different names for the registers, add a
macro that generates the names appropriately.
-Upstream-Status: Pending
+Upstream-Status: Submitted [https://github.com/libunwind/libunwind/pull/711]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
@@ -14,11 +14,11 @@ Signed-off-by: Ross Burton <ross.burton@arm.com>
1 file changed, 39 insertions(+), 30 deletions(-)
diff --git a/src/coredump/_UCD_access_reg_linux.c b/src/coredump/_UCD_access_reg_linux.c
-index 27eef123..beefdb47 100644
+index 9d4ce0b8..dbdbc63c 100644
--- a/src/coredump/_UCD_access_reg_linux.c
+++ b/src/coredump/_UCD_access_reg_linux.c
-@@ -67,38 +67,47 @@ _UCD_access_reg (unw_addr_space_t as,
- goto badreg;
+@@ -100,38 +100,47 @@ _UCD_access_reg (unw_addr_space_t as UNUSED,
+ };
#else
#if defined(UNW_TARGET_MIPS)
+
@@ -94,7 +94,4 @@ index 27eef123..beefdb47 100644
+ [UNW_MIPS_R31] = EF_REG(31),
[UNW_MIPS_PC] = EF_CP0_EPC,
};
- #elif defined(UNW_TARGET_X86)
---
-2.34.1
-
+ #elif defined(UNW_TARGET_S390X)
diff --git a/meta/recipes-support/libunwind/libunwind_1.6.2.bb b/meta/recipes-support/libunwind/libunwind_1.8.0.bb
index 3208785124a..d57c8a38ece 100644
--- a/meta/recipes-support/libunwind/libunwind_1.6.2.bb
+++ b/meta/recipes-support/libunwind/libunwind_1.8.0.bb
@@ -3,17 +3,17 @@ DESCRIPTION = "a portable and efficient C programming interface (API) to determi
HOMEPAGE = "http://www.nongnu.org/libunwind"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=2d80c8ed4062b8339b715f90fa68cc9f"
-DEPENDS += "libatomic-ops"
DEPENDS:append:libc-musl = " libucontext"
-SRC_URI = "http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PV}.tar.gz \
+SRC_URI = "https://github.com/libunwind/libunwind/releases/download/v${PV}/libunwind-${PV}.tar.gz \
file://mips-byte-order.patch \
file://mips-coredump-register.patch \
- file://0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch \
- file://0001-src-Gtrace-remove-unguarded-print-calls.patch \
+ file://0001-Handle-musl-on-PPC32.patch \
+ file://linux-musl.patch \
+ file://force-enable-man.patch \
"
-SRC_URI[sha256sum] = "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976"
+SRC_URI[sha256sum] = "b6b3df40a0970c8f2865fb39aa2af7b5d6f12ad6c5774e266ccca4d6b8b72268"
inherit autotools multilib_header
@@ -22,7 +22,6 @@ COMPATIBLE_HOST:riscv32 = "null"
PACKAGECONFIG ??= ""
PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,xz"
PACKAGECONFIG[zlib] = "--enable-zlibdebuginfo,--disable-zlibdebuginfo,zlib"
-PACKAGECONFIG[latexdocs] = "--enable-documentation, --disable-documentation, latex2man-native"
EXTRA_OECONF = "--enable-static"
@@ -32,8 +31,10 @@ ARM_INSTRUCTION_SET:armv5 = "arm"
LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
+DEPENDS:append:libc-musl:powerpc = " libatomic-ops"
+LDFLAGS:append:libc-musl:powerpc = " -latomic"
+
SECURITY_LDFLAGS:append:libc-musl = " -lssp_nonshared"
-CACHED_CONFIGUREVARS:append:libc-musl = " LDFLAGS='${LDFLAGS} -lucontext'"
do_install:append () {
oe_multilib_header libunwind.h