From 8a55ab995dfa89736ead8d7e7e5e9b950536c53f Mon Sep 17 00:00:00 2001 From: bluerise Date: Tue, 25 May 2021 15:22:04 +0000 Subject: [PATCH] Add support for OpenBSD/arm64 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, https://github.com/mono/boringssl/compare/mono...bluerise:obsd is necessary for boringssl so that it can be built. - And last, bdwgc needs to be patches as well: https://github.com/Unity-Technologies/bdwgc/pull/62 --- src/mono/mono/utils/mono-sigcontext.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mono/mono/utils/mono-sigcontext.h b/src/mono/mono/utils/mono-sigcontext.h index f9885a9f5d77b3..a385b0e0fe39ea 100644 --- a/src/mono/mono/utils/mono-sigcontext.h +++ b/src/mono/mono/utils/mono-sigcontext.h @@ -488,6 +488,12 @@ typedef struct ucontext { #define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_sp) #define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x [ARMREG_R0]) #define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x)) +#elif defined(__OpenBSD__) + /* ucontext_t == sigcontext */ + #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->sc_elr) + #define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->sc_sp) + #define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->sc_x [ARMREG_R0]) + #define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->sc_x)) #elif !defined(HOST_WIN32) #include #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.pc)