summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libunwind/libunwind
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/libunwind/libunwind')
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch81
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch45
-rw-r--r--meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch54
-rw-r--r--meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch62
4 files changed, 242 insertions, 0 deletions
diff --git a/meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch b/meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch
new file mode 100644
index 0000000000..8bcc252bad
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch
@@ -0,0 +1,81 @@
1From e623c7703945a5eb6c9a30586ec5e23b2f7396f6 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] 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
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12Upstream-Status: Pending
13
14 src/coredump/_UCD_internal.h | 34 ++++++++++++++++++++++++++++++++++
15 src/mips/getcontext.S | 3 +--
16 2 files changed, 35 insertions(+), 2 deletions(-)
17
18Index: git/src/coredump/_UCD_internal.h
19===================================================================
20--- git.orig/src/coredump/_UCD_internal.h
21+++ git/src/coredump/_UCD_internal.h
22@@ -44,6 +44,41 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
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;
64Index: git/src/mips/getcontext.S
65===================================================================
66--- git.orig/src/mips/getcontext.S
67+++ git/src/mips/getcontext.S
68@@ -24,12 +24,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING
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
diff --git a/meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch b/meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch
new file mode 100644
index 0000000000..9aed419a12
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch
@@ -0,0 +1,45 @@
1From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 06:44:07 +0000
4Subject: [PATCH] backtrace: Use only with glibc and uclibc
5
6backtrace API is glibc specific not linux specific
7so make it behave so.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Pending
12
13 tests/test-coredump-unwind.c | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
17index 5254708..8767b42 100644
18--- a/tests/test-coredump-unwind.c
19+++ b/tests/test-coredump-unwind.c
20@@ -57,7 +57,9 @@
21 #include <grp.h>
22
23 /* For SIGSEGV handler code */
24+#ifdef __GLIBC__
25 #include <execinfo.h>
26+#endif
27 #include <sys/ucontext.h>
28
29 #include <libunwind-coredump.h>
30@@ -238,11 +240,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
31 ip);
32
33 {
34+#ifdef __GLIBC__
35 /* glibc extension */
36 void *array[50];
37 int size;
38 size = backtrace(array, 50);
39-#ifdef __linux__
40 backtrace_symbols_fd(array, size, 2);
41 #endif
42 }
43--
442.6.4
45
diff --git a/meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch b/meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch
new file mode 100644
index 0000000000..371013aaaa
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch
@@ -0,0 +1,54 @@
1From f5df01655a4b76d4fe415747de581d94ac593e6a 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] 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
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14Upstream-Status: Pending
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 31f83ba..3aaa34e 100644
21--- a/src/x86/Gos-linux.c
22+++ b/src/x86/Gos-linux.c
23@@ -281,27 +281,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- 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 #endif
52--
531.8.3.1
54
diff --git a/meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch b/meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
new file mode 100644
index 0000000000..0dff2c86dc
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
@@ -0,0 +1,62 @@
1From 24484e80b3e329c9edee1995e102f8612eedb79c 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] 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 23f615e..deabdfd 100644
50--- a/include/libunwind_i.h
51+++ b/include/libunwind_i.h
52@@ -95,6 +95,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--
611.9.2
62