New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FreeBSD/aarch64 support #83

Merged
merged 1 commit into from Aug 7, 2018

Conversation

Projects
None yet
2 participants
@myfreeweb
Contributor

myfreeweb commented Jul 18, 2018

I'm actually quite confused about how aarch64 contexts are implemented…

  • there's unw_tdep_context_t / unw_sigcontext, a private copy of Linux structs
    • filled by the inline assembly in the unw_tdep_getcontext macro??
    • but there was a reference to fpsimd_context from Linux system headers??
    • the assembly does not seem to save the float/simd registers though??

So I added an internal Linux-compatible fpsimd struct and that compiles…

I'm not sure how to properly test, make check tries to link the library twice for some reason:

/usr/bin/ld: error: duplicate symbol: dwarf_search_unwind_table_int
>>> defined at Gfind_proc_info-lsb.c:809 (dwarf/Gfind_proc_info-lsb.c:809)
>>>            Gfind_proc_info-lsb.o:(_Uaarch64_dwarf_search_unwind_table) in archive ../src/.libs/libunwind-aarch64.a
>>> defined at Gfind_proc_info-lsb.c:809 (dwarf/Gfind_proc_info-lsb.c:809)
>>>            Lfind_proc_info-lsb.o:(_ULaarch64_dwarf_search_unwind_table) in archive /mnt/greg/src/github.com/libunwind/libunwind/src/.libs/libunwind.a

Tried to run something manually:

  • run-coredump-unwind (and -mdi) expect GNU binaries: mktemp: illegal option -- -
  • test-ptrace-misc returns sum = 0
  • test-strerror and test-proc-info exit 0 without printing anything
  • forker segfaults in strtol_l
  • the example from issue #68 prints something reasonable (ip = 20394, sp = ffffffffdaf0) and does not segfault! :)
@djwatson

This comment has been minimized.

Show comment
Hide comment
@djwatson

djwatson Jul 30, 2018

Member

This patch seems to implement _UPT_access_fpreg for aarch64, is that correct?

It looks fine to me for that, but your PR title and description seem to be completely unrelated to what the patch is doing.

Member

djwatson commented Jul 30, 2018

This patch seems to implement _UPT_access_fpreg for aarch64, is that correct?

It looks fine to me for that, but your PR title and description seem to be completely unrelated to what the patch is doing.

@myfreeweb

This comment has been minimized.

Show comment
Hide comment
@myfreeweb

myfreeweb Jul 30, 2018

Contributor

@djwatson that's one part of it. (yeah I didn't even notice that wasn't OS-specific) there's also aarch64 support in _UCD_access_reg_freebsd.c, and unw_fpsimd_context_t instead of using that struct directly from Linux headers to make it work on FreeBSD

Contributor

myfreeweb commented Jul 30, 2018

@djwatson that's one part of it. (yeah I didn't even notice that wasn't OS-specific) there's also aarch64 support in _UCD_access_reg_freebsd.c, and unw_fpsimd_context_t instead of using that struct directly from Linux headers to make it work on FreeBSD

@djwatson

This comment has been minimized.

Show comment
Hide comment
@djwatson

djwatson Aug 7, 2018

Member

Gotchya. Updating the commit message and merging, thanks.

Member

djwatson commented Aug 7, 2018

Gotchya. Updating the commit message and merging, thanks.

@djwatson djwatson merged commit fe2e943 into libunwind:master Aug 7, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment