This is an archive of the discontinued LLVM Phabricator instance.

[libunwind] Define _Unwind_Backtrace for powerpc, sparc
ClosedPublic

Authored by thesamesam on Feb 5 2022, 9:15 PM.

Details

Summary

Add SPARC to the list of platforms for which we provide a full
unwind implementation which leads to _Unwind_Backtrace being defined within
libunwind.so.

Likewise for PPC (see D118320 for background).

Diff Detail

Event Timeline

thesamesam created this revision.Feb 5 2022, 9:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2022, 9:15 PM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
thesamesam requested review of this revision.Feb 5 2022, 9:15 PM

During investigation for D118320, it was found that:

  • GCC on PPC32 defines __powerpc__, but not __ppc__ (Clang on PPC32 defines both)
  • GCC on PPC64 defines both __powerpc__ and __powerpc64__ (Clang on PPC64 defines both)

So problem with functions such as _Unwind_Backtrace not being available is probably also present in libunwind built by GCC on PPC32.
Then defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) could be merged into simple defined(__powerpc__).

Fix similar issue for PPC32.

thesamesam retitled this revision from [libunwind] [sparc] Define _Unwind_Backtrace to [libunwind] Define _Unwind_Backtrace for powerpc, sparc.Feb 5 2022, 11:04 PM
thesamesam edited the summary of this revision. (Show Details)
Arfrever accepted this revision.Feb 5 2022, 11:14 PM
MaskRay accepted this revision.Feb 7 2022, 1:01 AM

LGTM.

This revision is now accepted and ready to land.Feb 7 2022, 1:01 AM

Looks okay here too check-unwind tests passes and _Unwind_Backtrace seems to work on Gentoo/sparc64, at least.

[100%] Running libunwind tests
-- Testing: 11 tests, 11 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..

Testing Time: 1.82s
  Unsupported: 4
  Passed     : 7
[100%] Built target check-unwind
This revision was automatically updated to reflect the committed changes.