libgcc and libunwind have different flavours of register_frame. Both flavours are already correctly handled, except that the code to handle the libunwind flavour is guarded by APPLE. This change uses the presence of unw_add_dynamic_fde in libunwind instead to detect whether libunwind is used, rather than hardcoding it as Apple vs. non-Apple.
Fixes PR44074.
Thanks to Albert Jin <albert.jin@gmail.com> and Chris Schafmeister <chris.schaf@verizon.net> for identifying the problem.
Should this be a runtime check and not a compile time check?