[oe-commits] [openembedded-core] 45/63: glibc: Enable backtrace from abort on ARM

git at git.openembedded.org git at git.openembedded.org
Tue Dec 13 22:57:03 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 93bf8713d8e13c278543baea94fb8dad0cb80e49
Author: Yuanjie Huang <yuanjie.huang at windriver.com>
AuthorDate: Fri Dec 9 11:49:34 2016 -0600

    glibc: Enable backtrace from abort on ARM
    
    ARM stack frames for abort and raise were limited to the the actual
    abort and raise call, such as:
    
    Obtained 4 stack frames.
    ./test-app(print_trace+0x1c) [0x10a08]
    ./test-app() [0x10b3c]
    /lib/libc.so.6(__default_sa_restorer+0) [0x4adae1e0]
    /lib/libc.so.6(gsignal+0xa0) [0x4adacf74]
    
    This is not terribly useful when trying to figure out what function
    may have called called the abort, especially when using pthreads.
    
    After the change the trace would now look like:
    
    Obtained 8 stack frames.
    ./test-app(print_trace+0x1c) [0x10a08]
    ./test-app() [0x10b3c]
    /lib/libc.so.6(__default_sa_restorer+0) [0x4befe1e0]
    /lib/libc.so.6(gsignal+0xa0) [0x4befcf74]
    /lib/libc.so.6(abort+0x134) [0x4befe358]
    ./test-app(dummy_function+0x50) [0x10adc]
    ./test-app(main+0xd4) [0x10c24]
    /lib/libc.so.6(__libc_start_main+0x114) [0x4bee7a58]
    
    Signed-off-by: Yuanjie Huang <yuanjie.huang at windriver.com>
    Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-core/glibc/glibc.inc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index e85c704..7bae0e9 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -78,3 +78,9 @@ do_configure_prepend() {
 }
 
 GLIBC_ADDONS ?= "nptl,libidn"
+
+# Enable backtrace from abort()
+do_configure_append_arm () {
+	echo "CFLAGS-abort.c = -fasynchronous-unwind-tables" >> ${B}/configparms
+	echo "CFLAGS-raise.c = -fasynchronous-unwind-tables" >> ${B}/configparms
+}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list