Skip to content

Commit 4392f8b

Browse files
Add support for OpenBSD/arm64 (#53233)
There are three changes required to build mono on OpenBSD/arm64. - The first one is to provide the UCONTEXT macros, which for OpenBSD simply map to sigcontext. - Furthermore as stated in issue mono/mono#21005, mono/boringssl@mono...bluerise:obsd is necessary for boringssl so that it can be built. - And last, bdwgc needs to be patches as well: Unity-Technologies/bdwgc#62 Co-authored-by: bluerise <bluerise@users.noreply.github.com>
1 parent ef6cea2 commit 4392f8b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/mono/mono/utils/mono-sigcontext.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,12 @@ typedef struct ucontext {
488488
#define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_sp)
489489
#define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x [ARMREG_R0])
490490
#define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x))
491+
#elif defined(__OpenBSD__)
492+
/* ucontext_t == sigcontext */
493+
#define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->sc_elr)
494+
#define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->sc_sp)
495+
#define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->sc_x [ARMREG_R0])
496+
#define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->sc_x))
491497
#elif !defined(HOST_WIN32)
492498
#include <ucontext.h>
493499
#define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.pc)

0 commit comments

Comments
 (0)