Fix build on FreeBSD

On FreeBSD the following syntax is used:
mr REGA,REGB
This commit is contained in:
pkubaj 2019-02-04 16:10:06 +00:00 committed by Aliaksey Kandratsenka
parent 98ac4ee9bc
commit fba6ce0e7a
1 changed files with 4 additions and 0 deletions

View File

@ -97,7 +97,11 @@ int GET_STACK_TRACE_OR_FRAMES {
// different asm syntax. I don't know quite the best way to discriminate
// systems using the old as from the new one; I've gone with __APPLE__.
// TODO(csilvers): use autoconf instead, to look for 'as --version' == 1 or 2
#ifdef __FreeBSD__
__asm__ volatile ("mr %0,1" : "=r" (sp));
#else
__asm__ volatile ("mr %0,r1" : "=r" (sp));
#endif
// On PowerPC, the "Link Register" or "Link Record" (LR), is a stack
// entry that holds the return address of the subroutine call (what