summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libunwind
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/libunwind')
-rw-r--r--meta/recipes-support/libunwind/libunwind.inc22
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch62
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-src-Gtrace-remove-unguarded-print-calls.patch52
-rw-r--r--meta/recipes-support/libunwind/libunwind/0003-x86-Stub-out-x86_local_resume.patch54
-rw-r--r--meta/recipes-support/libunwind/libunwind/0004-Fix-build-on-mips-musl.patch84
-rw-r--r--meta/recipes-support/libunwind/libunwind/0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch16
-rw-r--r--meta/recipes-support/libunwind/libunwind/0006-Fix-for-X32.patch32
-rw-r--r--meta/recipes-support/libunwind/libunwind/mips-byte-order.patch35
-rw-r--r--meta/recipes-support/libunwind/libunwind/mips-coredump-register.patch100
-rw-r--r--meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch44
-rw-r--r--meta/recipes-support/libunwind/libunwind_1.5.0.bb26
-rw-r--r--meta/recipes-support/libunwind/libunwind_1.6.2.bb42
12 files changed, 236 insertions, 333 deletions
diff --git a/meta/recipes-support/libunwind/libunwind.inc b/meta/recipes-support/libunwind/libunwind.inc
deleted file mode 100644
index 76a1bf6246..0000000000
--- a/meta/recipes-support/libunwind/libunwind.inc
+++ /dev/null
@@ -1,22 +0,0 @@
1SUMMARY = "Library for obtaining the call-chain of a program"
2DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program"
3HOMEPAGE = "http://www.nongnu.org/libunwind"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://COPYING;md5=2d80c8ed4062b8339b715f90fa68cc9f"
6DEPENDS += "libatomic-ops"
7
8inherit autotools multilib_header
9
10PACKAGECONFIG ??= ""
11PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,xz"
12PACKAGECONFIG[latexdocs] = "--enable-documentation, --disable-documentation, latex2man-native"
13
14EXTRA_OECONF_arm = "--enable-debug-frame"
15EXTRA_OECONF_armeb = "--enable-debug-frame"
16EXTRA_OECONF_aarch64 = "--enable-debug-frame"
17
18do_install_append () {
19 oe_multilib_header libunwind.h
20}
21
22BBCLASSEXTEND = "native"
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 @@
1From 599f10ac3a24e419a93f97fddbe14de01b1185ea Mon Sep 17 00:00:00 2001
2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3Date: Tue, 13 May 2014 23:32:27 +0200
4Subject: [PATCH 1/6] Add AO_REQUIRE_CAS to fix build on ARM < v6
5
6ARM earlier than ARMv6, such as ARMv4 and ARMv5 do not provide
7optimize atomic operations in libatomic_ops. Since libunwind is using
8such operations, it should define AO_REQUIRE_CAS before including
9<atomic_ops.h> so that libatomic_ops knows it should use emulated
10atomic operations instead (even though they are obviously a lot more
11expensive).
12
13Also, while real atomic operations are all inline functions and
14therefore linking against libatomic_ops was not required, the emulated
15atomic operations actually require linking against libatomic_ops, so
16the commented AC_CHECK_LIB test in acinclude.m4 is uncommented to make
17sure we link against libatomic_ops.
18
19Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
20Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
21
22Upstream-Status: Pending
23Taken from:
24https://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
31diff --git a/acinclude.m4 b/acinclude.m4
32index 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 ])
48diff --git a/include/libunwind_i.h b/include/libunwind_i.h
49index 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--
612.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 @@
1From 9b27fa9bcd5cadd4c841c42710f41a090377e531 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Fri, 24 Mar 2023 16:18:44 +0000
4Subject: [PATCH] src/Gtrace: remove unguarded print() calls
5
6There is a use of printf() without #include stdio.h in src/arm/Gtrace.c,
7which results in a compiler error if clang 16 is used:
8
9src/arm/Gtrace.c:529:7: error: call to undeclared library function
10'printf' with type 'int (const char *, ...)'; ISO C99 and later do not
11support implicit function declarations [-Wimplicit-function-declaration]
12
13Replace the printf("XXX") with a Dprintf, so it doesn't pull stdio in
14unless in a debug build, and reword the message to be clearer.
15
16Also there is another printf("XXX") inside a FreeBSD-specific block in
17the UNW_ARM_FRAME_SIGRETURN case, replace this with a #error as the code
18needs to be implemented.
19
20Fixes #482.
21
22Upstream-Status: Backport [9b27fa9bcd5cadd4c841c42710f41a090377e531]
23Signed-off-by: Ross Burton <ross.burton@arm.com>
24---
25 src/arm/Gtrace.c | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
27
28diff --git a/src/arm/Gtrace.c b/src/arm/Gtrace.c
29index 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--
512.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 @@
1From f6866b9e4a6341c50eb1d923dbf48eca2ca40140 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 22 Mar 2016 16:19:29 +0000
4Subject: [PATCH 3/6] x86: Stub out x86_local_resume()
5
6its purpose seems
7to be unwinding across signal handler boundaries, which cannot happen
8in correct programs anyway. Replacing the whole function with
9something like *(volatile char *)0=0; (i.e. crash), gets a working
10libunwind
11
12Upstream-Status: Pending
13Signed-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
19diff --git a/src/x86/Gos-linux.c b/src/x86/Gos-linux.c
20index 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--
532.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 @@
1From 6bdab5cc8f1e2ec5f84fc9f59f1699a726980709 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 23 Mar 2016 06:08:59 +0000
4Subject: [PATCH 4/6] Fix build on mips/musl
5
6Do not include endian.h on musl it includes
7further headers which can not be compiled in __ASSEMBLER__
8 mode
9
10Upstream-Status: Pending
11Signed-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
18diff --git a/src/coredump/_UCD_internal.h b/src/coredump/_UCD_internal.h
19index 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;
64diff --git a/src/mips/getcontext.S b/src/mips/getcontext.S
65index 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--
832.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 @@
1From 02919d74b1599979884f9cee466ed392d9fc4819 Mon Sep 17 00:00:00 2001 1From 24c751f9d21e892a9833e1b70a696b07872b0f7f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 9 Jul 2016 01:07:53 +0000 3Date: Sat, 9 Jul 2016 01:07:53 +0000
4Subject: [PATCH 5/6] ppc32: Consider ucontext mismatches between glibc and 4Subject: [PATCH] ppc32: Consider ucontext mismatches between glibc and
5
5 musl 6 musl
6 7
7This helps in porting libunwind onto musl based systems 8This 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
31diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c 32diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c
32index ba30244..c5312d9 100644 33index 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
229diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c 230diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c
230index c82d1c9..6c31baa 100644 231index 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--
2482.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 @@
1From 7a4fd5933cc795df85cdd85168fe54fbaec4dcec Mon Sep 17 00:00:00 2001
2From: Christopher Larson <chris_larson@mentor.com>
3Date: Tue, 13 Dec 2016 09:50:34 -0700
4Subject: [PATCH 6/6] Fix for X32
5
6Apply patch to fix the X32 build from https://github.com/sjnewbury/x32.
7
8Upstream-Status: Pending
9Signed-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
15diff --git a/src/x86_64/Gos-linux.c b/src/x86_64/Gos-linux.c
16index 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--
312.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 @@
1From dbbf8110ed3fd2cbac20a8ec2ac769e13c67bab1 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Tue, 16 Jan 2024 18:22:38 +0000
4Subject: [PATCH 2/2] byte order
5
6endian.h on musl/mips can't be included in __ASSEMBLER__ mode,
7so use the __BYTE_ORDER__ symbol instead.
8
9Upstream-Status: Pending
10Signed-off-by: Ross Burton <ross.burton@arm.com>
11---
12 src/mips/getcontext.S | 3 +--
13 1 file changed, 1 insertion(+), 2 deletions(-)
14
15diff --git a/src/mips/getcontext.S b/src/mips/getcontext.S
16index 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--
342.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 @@
1From 7750e2a29b084ee033acc82abab410035e220d3f Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Tue, 16 Jan 2024 18:21:26 +0000
4Subject: [PATCH 1/2] coredump-mips-register
5
6glibc and musl have different names for the registers, add a
7macro that generates the names appropriately.
8
9Upstream-Status: Pending
10Signed-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
16diff --git a/src/coredump/_UCD_access_reg_linux.c b/src/coredump/_UCD_access_reg_linux.c
17index 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--
992.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 @@
1From 49b21f0fe5fb93b30b94cc449429fd33de0652a7 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Thu, 18 Aug 2016 14:46:32 +0100
4Subject: [PATCH] If you:
5
6TCLIBC=musl bitbake unwind
7TCLIBC=musl bitbake gcc-runtime -c cleansstate
8TCLIBC=musl bitbake gcc-runtime
9
10you will see libstdc++ fail to build due to finding libunwind's header file.
11
12Khem: "When we build any of gcc components they expect to use internal version
13and that works with glibc based gcc since the search headers first look into gcc
14headers, however with musl the gcc headers are searched after the standard
15headers ( which is by design the right thing )."
16
17This patch hacks around the issue by looking for a define used during gcc-runtime's
18build and skipping to the internal header in that case.
19
20[YOCTO #10129]
21
22RP 2016/8/18
23
24Upstream-Status: Inappropriate [really need to fix gcc]
25
26---
27 include/unwind.h | 4 ++++
28 1 file changed, 4 insertions(+)
29
30diff --git a/include/unwind.h b/include/unwind.h
31index 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
diff --git a/meta/recipes-support/libunwind/libunwind_1.5.0.bb b/meta/recipes-support/libunwind/libunwind_1.5.0.bb
deleted file mode 100644
index 5e4693e205..0000000000
--- a/meta/recipes-support/libunwind/libunwind_1.5.0.bb
+++ /dev/null
@@ -1,26 +0,0 @@
1require libunwind.inc
2
3SRC_URI = "http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PV}.tar.gz \
4 file://0001-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch \
5 file://0003-x86-Stub-out-x86_local_resume.patch \
6 file://0004-Fix-build-on-mips-musl.patch \
7 file://0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch \
8 file://0006-Fix-for-X32.patch \
9 "
10SRC_URI_append_libc-musl = " file://musl-header-conflict.patch"
11
12SRC_URI[md5sum] = "c6923dda0675f6a4ef21426164dc8b6a"
13SRC_URI[sha256sum] = "90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017"
14
15EXTRA_OECONF_append_libc-musl = " --disable-documentation --disable-tests --enable-static"
16
17# http://errors.yoctoproject.org/Errors/Details/20487/
18ARM_INSTRUCTION_SET_armv4 = "arm"
19ARM_INSTRUCTION_SET_armv5 = "arm"
20
21COMPATIBLE_HOST_riscv64 = "null"
22COMPATIBLE_HOST_riscv32 = "null"
23
24LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
25
26SECURITY_LDFLAGS_append_libc-musl = " -lssp_nonshared"
diff --git a/meta/recipes-support/libunwind/libunwind_1.6.2.bb b/meta/recipes-support/libunwind/libunwind_1.6.2.bb
new file mode 100644
index 0000000000..3208785124
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind_1.6.2.bb
@@ -0,0 +1,42 @@
1SUMMARY = "Library for obtaining the call-chain of a program"
2DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program"
3HOMEPAGE = "http://www.nongnu.org/libunwind"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://COPYING;md5=2d80c8ed4062b8339b715f90fa68cc9f"
6DEPENDS += "libatomic-ops"
7DEPENDS:append:libc-musl = " libucontext"
8
9SRC_URI = "http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PV}.tar.gz \
10 file://mips-byte-order.patch \
11 file://mips-coredump-register.patch \
12 file://0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch \
13 file://0001-src-Gtrace-remove-unguarded-print-calls.patch \
14 "
15
16SRC_URI[sha256sum] = "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976"
17
18inherit autotools multilib_header
19
20COMPATIBLE_HOST:riscv32 = "null"
21
22PACKAGECONFIG ??= ""
23PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,xz"
24PACKAGECONFIG[zlib] = "--enable-zlibdebuginfo,--disable-zlibdebuginfo,zlib"
25PACKAGECONFIG[latexdocs] = "--enable-documentation, --disable-documentation, latex2man-native"
26
27EXTRA_OECONF = "--enable-static"
28
29# http://errors.yoctoproject.org/Errors/Details/20487/
30ARM_INSTRUCTION_SET:armv4 = "arm"
31ARM_INSTRUCTION_SET:armv5 = "arm"
32
33LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
34
35SECURITY_LDFLAGS:append:libc-musl = " -lssp_nonshared"
36CACHED_CONFIGUREVARS:append:libc-musl = " LDFLAGS='${LDFLAGS} -lucontext'"
37
38do_install:append () {
39 oe_multilib_header libunwind.h
40}
41
42BBCLASSEXTEND = "native"