kumquat-buildroot/package/gcc/4.9.4/873-xtensa-fix-_Unwind_GetCFA.patch
Thomas Petazzoni 50c02bd72b gcc: bump 4.9 series to 4.9.4
Two patches are removed, as they have been upstreamed:

 - 130-fix_build_with_gcc-6.patch (svn commit 233721, Git commit
   8c3fa311caa86f61b4e28d1563d1110b44340fb2)

 - 920-libgcc-remove-unistd-header.patch (svn commit 226092, Git commit
   e940d7953f06af11d09229a29ecbcc1ba25b378d)

All other patches have simply been refreshed, with no manual edit
needed.

A build+runtime test has been done with an ARM, Cortex-A8, EABIhf, musl
configuration, booted under Qemu.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-08-04 22:45:48 +02:00

41 lines
1.4 KiB
Diff

From 15c7c4d39b317f0d902ef28fd43eca5c3369f891 Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@gmail.com>
Date: Sat, 15 Aug 2015 05:12:11 +0300
Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA
Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame
higher than what was actually used by code at context->ra. This results
in invalid CFA value in signal frames and premature unwinding completion
in forced unwinding used by uClibc NPTL thread cancellation.
Returning context->sp from _Unwind_GetCFA makes all CFA values valid and
matching code that used them.
2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
libgcc/
* config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
context->sp instead of context->cfa.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Backported from: r226964
libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
index 35f7797..ef6b900 100644
--- a/libgcc/config/xtensa/unwind-dw2-xtensa.c
+++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c
@@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
_Unwind_Word
_Unwind_GetCFA (struct _Unwind_Context *context)
{
- return (_Unwind_Ptr) context->cfa;
+ return (_Unwind_Ptr) context->sp;
}
/* Overwrite the saved value for register INDEX in CONTEXT with VAL. */
--
1.8.1.4