Skip to content

Commit 8593792

Browse files
authored
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.
1 parent 6644796 commit 8593792

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/stackwalk.c

+6
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,13 @@ int jl_simulate_longjmp(jl_jmp_buf mctx, bt_context_t *c) JL_NOTSAFEPOINT
992992
#endif
993993
#elif defined(_OS_LINUX_) && defined(__GLIBC__)
994994
__jmp_buf *_ctx = &mctx->__jmpbuf;
995+
#if defined(_CPU_AARCH64_)
996+
// Only on aarch64-linux libunwind uses a different struct than system's one:
997+
// <https://github.com/libunwind/libunwind/blob/e63e024b72d35d4404018fde1a546fde976da5c5/include/libunwind-aarch64.h#L193-L205>.
998+
struct unw_sigcontext *mc = &c->uc_mcontext;
999+
#else
9951000
mcontext_t *mc = &c->uc_mcontext;
1001+
#endif
9961002
#if defined(_CPU_X86_)
9971003
// https://github.com/bminor/glibc/blame/master/sysdeps/i386/__longjmp.S
9981004
// https://github.com/bminor/glibc/blame/master/sysdeps/i386/jmpbuf-offsets.h

0 commit comments

Comments
 (0)