Skip to content

Commit c60704b

Browse files
giordanoN5N3
authored andcommitted
Fix compilation warning on aarch64-linux (#56480)
This fixes the warning: ``` /cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c: In function 'jl_simulate_longjmp': /cache/build/default-aws-aarch64-ci-1-3/julialang/julia-master/src/stackwalk.c:995:22: warning: initialization of 'mcontext_t *' {aka 'struct sigcontext *'} from incompatible pointer type 'struct unw_sigcontext *' [-Wincompatible-pointer-types] 995 | mcontext_t *mc = &c->uc_mcontext; | ^ ``` This is the last remaining warning during compilation on aarch64-linux. (cherry picked from commit 8593792)
1 parent c6be3e9 commit c60704b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/stackwalk.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,13 @@ static void jl_rec_backtrace(jl_task_t *t) JL_NOTSAFEPOINT
919919
memset(&c, 0, sizeof(c));
920920
#if defined(_OS_LINUX_) && defined(__GLIBC__)
921921
__jmp_buf *mctx = &t->ctx.ctx.uc_mcontext->__jmpbuf;
922+
#if defined(_CPU_AARCH64_)
923+
// Only on aarch64-linux libunwind uses a different struct than system's one:
924+
// <https://github.com/libunwind/libunwind/blob/e63e024b72d35d4404018fde1a546fde976da5c5/include/libunwind-aarch64.h#L193-L205>.
925+
struct unw_sigcontext *mc = &c.uc_mcontext;
926+
#else
922927
mcontext_t *mc = &c.uc_mcontext;
928+
#endif
923929
#if defined(_CPU_X86_)
924930
// https://github.com/bminor/glibc/blame/master/sysdeps/i386/__longjmp.S
925931
// https://github.com/bminor/glibc/blame/master/sysdeps/i386/jmpbuf-offsets.h

0 commit comments

Comments
 (0)