Patchwork [meta-oe] libunwind: Fix build on arm < v6

login
register
mail settings
Submitter Khem Raj
Date June 13, 2013, 7:12 a.m.
Message ID <1371107558-23909-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/51663/
State Accepted, archived
Commit cd2e0043d8fd009f3230e0c9cdfb63fc84ed9669
Headers show

Comments

Khem Raj - June 13, 2013, 7:12 a.m.
atomics that are needed for libunuwind are not available on
arm < v6

Fixes errors like

| ../src/.libs/libunwind.so: error: undefined reference to
'AO_fetch_and_add1'
| ../src/.libs/libunwind.so: error: undefined reference to
'AO_fetch_and_add'
| collect2: error: ld returned 1 exit status

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/recipes-support/libunwind/libunwind.inc |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Patch

diff --git a/meta-oe/recipes-support/libunwind/libunwind.inc b/meta-oe/recipes-support/libunwind/libunwind.inc
index f028766..2e1504e 100644
--- a/meta-oe/recipes-support/libunwind/libunwind.inc
+++ b/meta-oe/recipes-support/libunwind/libunwind.inc
@@ -6,7 +6,21 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=3fced11d6df719b47505837a51c16ae5"
 SRC_URI = "http://download.savannah.nongnu.org/releases/${BPN}/${BPN}-${PV}.tar.gz"
 
 inherit autotools
-
 EXTRA_OECONF_arm = "--enable-debug-frame"
 
+CFLAGS += "${ATOMICOPS}"
+ATOMICOPS_armv5 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS_armv4 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS ?= ""
+
+LDFLAGS += "${LIBATOMICS}"
+LIBATOMICS_armv5 = "-latomic_ops"
+LIBATOMICS_armv4 = "-latomic_ops"
+LIBATOMICS ?= ""
+
+DEPENDS += "${DEPLIBATOMICS}"
+DEPLIBATOMICS_armv5 = "libatomics-ops"
+DEPLIBATOMICS_armv4 = "libatomics-ops"
+DEPLIBATOMICS ?= ""
+
 BBCLASSEXTEND = "native"