blob: 82ca307391631e4a9e0b8311deae8cdaae9276a5 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From c8ca71d40bc51e255457cd4374dd45ec9ebf8ae1 Mon Sep 17 00:00:00 2001
2From: Jun He <jun.he@arm.com>
3Date: Mon, 3 Jul 2017 07:18:32 +0000
4Subject: [PATCH] Fixed stack trace generation on aarch64
5
6Change-Id: I9801239c98cb7362ed07e8b9ec2ba7e45749dba7
7Signed-off-by: Jun He <jun.he@arm.com>
8
9* fixes also this error when building with -Werror=return-type:
10 debug.c:698:1: error: no return statement in function returning non-void [-Werror=return-type]
11
12Upstream-Status: Backport [https://github.com/antirez/redis/commit/c8ca71d40bc51e255457cd4374dd45ec9ebf8ae1]
13
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15---
16 src/Makefile | 2 +-
17 src/debug.c | 2 ++
18 2 files changed, 3 insertions(+), 1 deletion(-)
19
20diff --git a/src/Makefile b/src/Makefile
21index 24e960593eb..a1ff4258a9d 100644
22--- a/src/Makefile
23+++ b/src/Makefile
24@@ -40,7 +40,7 @@
25 endif
26
27 # To get ARM stack traces if Redis crashes we need a special C flag.
28-ifneq (,$(findstring armv,$(uname_M)))
29+ifneq (,$(filter aarch64 armv,$(uname_M)))
30 CFLAGS+=-funwind-tables
31 endif
32
33diff --git a/src/debug.c b/src/debug.c
34index a4caa49f285..c976d0ed919 100644
35--- a/src/debug.c
36+++ b/src/debug.c
37@@ -691,6 +691,8 @@
38 return (void*) uc->uc_mcontext.sc_ip;
39 #elif defined(__arm__) /* Linux ARM */
40 return (void*) uc->uc_mcontext.arm_pc;
41+ #elif defined(__aarch64__) /* Linux AArch64 */
42+ return (void*) uc->uc_mcontext.pc;
43 #endif
44 #else
45 return NULL;