Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Add FreeBSD/aarch64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Oct 16, 2018
1 parent aa5c90e commit 791a801
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/sys/freebsd/execinfo.d
Expand Up @@ -14,6 +14,9 @@ nothrow:

import core.sys.freebsd.dlfcn;

version (AArch64)
import ldc.llvmasm;

// Use extern (D) so that these functions don't collide with libexecinfo.

extern (D) int backtrace(void** buffer, int size)
Expand All @@ -25,6 +28,8 @@ extern (D) int backtrace(void** buffer, int size)
asm nothrow @trusted { mov p[EBP], EBP; }
else version (D_InlineAsm_X86_64)
asm nothrow @trusted { mov p[RBP], RBP; }
else version (AArch64)
__asm("str x29, $0", "=*m", p);
else
static assert(false, "Architecture not supported.");

Expand Down

0 comments on commit 791a801

Please sign in to comment.