Skip to content

Commit

Permalink
Fix compilation warning on aarch64-linux (#56480)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
giordano committed Nov 10, 2024
1 parent 5549ee2 commit 5aede69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stackwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,13 @@ static void jl_rec_backtrace(jl_task_t *t) JL_NOTSAFEPOINT
memset(&c, 0, sizeof(c));
#if defined(_OS_LINUX_) && defined(__GLIBC__)
__jmp_buf *mctx = &t->ctx.ctx.uc_mcontext->__jmpbuf;
#if defined(_CPU_AARCH64_)
// Only on aarch64-linux libunwind uses a different struct than system's one:
// <https://github.com/libunwind/libunwind/blob/e63e024b72d35d4404018fde1a546fde976da5c5/include/libunwind-aarch64.h#L193-L205>.
struct unw_sigcontext *mc = &c.uc_mcontext;
#else
mcontext_t *mc = &c.uc_mcontext;
#endif
#if defined(_CPU_X86_)
// https://github.com/bminor/glibc/blame/master/sysdeps/i386/__longjmp.S
// https://github.com/bminor/glibc/blame/master/sysdeps/i386/jmpbuf-offsets.h
Expand Down

0 comments on commit 5aede69

Please sign in to comment.