diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2015-10-27 13:41:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-12 08:42:25 +0000 |
commit | e2d441275d0d12cfdcaede554df6df18671b31ee (patch) | |
tree | 2853812c5279e1e9df4da5470d3203a1a998efe5 /meta | |
parent | ef690780720f5e70c319e798161d9aefa237987a (diff) | |
download | poky-e2d441275d0d12cfdcaede554df6df18671b31ee.tar.gz |
libunwind: fix build for qemuarm
(From OE-Core rev: 481eab06645c633eba98de9f8e8632ce7a11c41b)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch | 61 | ||||
-rw-r--r-- | meta/recipes-support/libunwind/libunwind_1.1.bb | 1 |
2 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch b/meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch new file mode 100644 index 0000000000..d552502818 --- /dev/null +++ b/meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch | |||
@@ -0,0 +1,61 @@ | |||
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 | |||
21 | Upstream-Status: Pending | ||
22 | Taken from: | ||
23 | https://raw.githubusercontent.com/rdnetto/teapot-buildroot/master/package/libunwind/libunwind-02-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch | ||
24 | |||
25 | --- | ||
26 | acinclude.m4 | 8 +------- | ||
27 | include/libunwind_i.h | 1 + | ||
28 | 2 files changed, 2 insertions(+), 7 deletions(-) | ||
29 | |||
30 | diff --git a/acinclude.m4 b/acinclude.m4 | ||
31 | index 497f7c2..9c15af1 100644 | ||
32 | --- a/acinclude.m4 | ||
33 | +++ b/acinclude.m4 | ||
34 | @@ -22,11 +22,5 @@ fi]) | ||
35 | AC_DEFUN([CHECK_ATOMIC_OPS], | ||
36 | [dnl Check whether the system has the atomic_ops package installed. | ||
37 | AC_CHECK_HEADERS(atomic_ops.h) | ||
38 | -# | ||
39 | -# Don't link against libatomic_ops for now. We don't want libunwind | ||
40 | -# to depend on libatomic_ops.so. Fortunately, none of the platforms | ||
41 | -# we care about so far need libatomic_ops.a (everything is done via | ||
42 | -# inline macros). | ||
43 | -# | ||
44 | -# AC_CHECK_LIB(atomic_ops, main) | ||
45 | + AC_CHECK_LIB(atomic_ops, main) | ||
46 | ]) | ||
47 | diff --git a/include/libunwind_i.h b/include/libunwind_i.h | ||
48 | index 23f615e..deabdfd 100644 | ||
49 | --- a/include/libunwind_i.h | ||
50 | +++ b/include/libunwind_i.h | ||
51 | @@ -95,6 +95,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
52 | (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0) | ||
53 | |||
54 | #ifdef HAVE_ATOMIC_OPS_H | ||
55 | +# define AO_REQUIRE_CAS | ||
56 | # include <atomic_ops.h> | ||
57 | static inline int | ||
58 | cmpxchg_ptr (void *addr, void *old, void *new) | ||
59 | -- | ||
60 | 1.9.2 | ||
61 | |||
diff --git a/meta/recipes-support/libunwind/libunwind_1.1.bb b/meta/recipes-support/libunwind/libunwind_1.1.bb index 29bdf944fd..aa62bcc662 100644 --- a/meta/recipes-support/libunwind/libunwind_1.1.bb +++ b/meta/recipes-support/libunwind/libunwind_1.1.bb | |||
@@ -6,6 +6,7 @@ SRC_URI += "\ | |||
6 | file://Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch \ | 6 | file://Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch \ |
7 | file://Link-libunwind-to-libgcc_s-rather-than-libgcc.patch \ | 7 | file://Link-libunwind-to-libgcc_s-rather-than-libgcc.patch \ |
8 | file://0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch \ | 8 | file://0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch \ |
9 | file://Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch \ | ||
9 | " | 10 | " |
10 | 11 | ||
11 | SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce" | 12 | SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce" |