Created attachment 194286 [details]
I made a patch that fixes the libunwind build on aarch64. It might contain bugs though...
(In reply to Greg V from comment #1)
With this patch my build fails with the following:
libtool: compile: cc -DHAVE_CONFIG_H -I. -I../include -I../include -I../include/tdep-aarch64 -I. -D_GNU_SOURCE -DNDEBUG -O2 -pipe -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -MT mi/backtrace.lo -MD -MP -MF mi/.deps/backtrace
.Tpo -c mi/backtrace.c -fPIC -DPIC -o mi/.libs/backtrace.o
mi/backtrace.c:71:7: error: no member named 'regs' in 'struct __mcontext'
../include/libunwind-common.h:108:29: note: expanded from macro 'unw_getcontext'
#define unw_getcontext(uc) unw_tdep_getcontext(uc)
../include/libunwind-aarch64.h:180:77: note: expanded from macro 'unw_tdep_getcontext'
register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs; \
mi/backtrace.c:26:9: warning: 'UNW_REMOTE_ONLY' is used as a header guard here, followed by #define of a different macro [-Wheader-guard]
mi/backtrace.c:28:9: note: 'UNW_LOCAL_ONLY' is defined here; did you mean 'UNW_REMOTE_ONLY'?
1 warning and 1 error generated.
(In reply to Mark Linimon from comment #2)
Looks like the patch didn't apply fully on your machine.
'unw_ctx->uc_mcontext.regs' should be replaced by 'unw_ctx->uc_mcontext.mc_gpregs.gp_x'.
It displays correctly in the diff view here on bugzilla...
(In reply to Greg V from comment #3)
You are correct; I am testing again with the patches applied.
A commit references this bug:
Date: Fri Jun 29 07:48:44 UTC 2018
New revision: 473531
Port to aarch64. Tested for no-harm on amd64.
While here, pet portlint.
Submitted by: greg at unrelenting.technology
Approved by: portmgr (tier-2 blanket)