diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-05-11 10:35:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 13:41:30 +0100 |
commit | ca8ae667ac9f60fce217c87154967a81da888d74 (patch) | |
tree | 2faf1dd3db122b5cba61074a9c6fba4558e91657 /meta/recipes-support/libunwind/libunwind | |
parent | 08a9f5dec693ba69dafe53b4ab05dc15d82ee40b (diff) | |
download | poky-ca8ae667ac9f60fce217c87154967a81da888d74.tar.gz |
libunwind: Upgrade to 1.2rc1+
This helps in compiling with gcc6
drop patches backported to 1.1
remove musl conditional patches, they should work
on glibc too now
(From OE-Core rev: d164b4dbcbba4dd7db4c4257e6cd876026c2e7eb)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/libunwind/libunwind')
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 @@ | |||
1 | From e623c7703945a5eb6c9a30586ec5e23b2f7396f6 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] 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 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | Upstream-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 | |||
18 | Index: 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; | ||
64 | Index: 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 @@ | |||
1 | From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 31 Dec 2015 06:44:07 +0000 | ||
4 | Subject: [PATCH] backtrace: Use only with glibc and uclibc | ||
5 | |||
6 | backtrace API is glibc specific not linux specific | ||
7 | so make it behave so. | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | Upstream-Status: Pending | ||
12 | |||
13 | tests/test-coredump-unwind.c | 4 +++- | ||
14 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c | ||
17 | index 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 | -- | ||
44 | 2.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 @@ | |||
1 | From f5df01655a4b76d4fe415747de581d94ac593e6a 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] 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 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | Upstream-Status: Pending | ||
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 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 | -- | ||
53 | 1.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 @@ | |||
1 | From 24484e80b3e329c9edee1995e102f8612eedb79c 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] 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 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 | -- | ||
61 | 1.9.2 | ||
62 | |||