Introduces a macro abstraction around capturing the bounds of a
function, which many platforms handle subtly differently (Mach-O, and
ELF, for example).
Also introduce an arm64[^-]* -> aarch64 available feature, to enable
more tests that would otherwise be excluded on Apple platforms, whose
target triples tend to take the form e.g. 'arm64-apple-macosx', rather
than 'aarch64-apple-macosx'.
Third, we implement the has-sme check using the appropriate sysctl, as
getauxval is not available on Darwin platforms.
There might be a cleaner way to enable these tests running on FreeBSD,
I'm open to suggestions.
Co-authored-by: Alexander Richardson <mail@alexrichardson.me>
This patch reimplements the SME ABI `__arm_za_disable` routine within
libunwind. This routine must be called before resuming from unwinding on
AArch64 platforms with SME support.
Before calling the routine, we need to check that SME is available. In
this patch, this is implemented for Linux-based platforms by checking
HWCAP2. It should be possible to implement this check for other
platforms as required.
This patch includes a test for this functionality. This test requires
SME, so on platforms without it, it will simply pass.