Created attachment 197897 [details] Patch to fix PowerPC build Building Mono of FreeBSD/PowerPC (32-bit) fails due to incorrect code in "mono/utils/mono-sigcontext.h" that prevents Mono from building. The below code change patch allows Mono to build: @@ -363,10 +363,10 @@ #elif defined(__FreeBSD__) typedef ucontext_t os_ucontext; - #define UCONTEXT_REG_Rn(ctx, n) ((ctx)->uc_mcontext.mc_gpr [(n)]) - #define UCONTEXT_REG_FPRn(ctx, n) ((ctx)->uc_mcontext.mc_fpreg [(n)]) - #define UCONTEXT_REG_NIP(ctx) ((ctx)->uc_mcontext.mc_srr0) - #define UCONTEXT_REG_LNK(ctx) ((ctx)->uc_mcontext.mc_lr) + #define UCONTEXT_REG_Rn(ctx, n) (((os_ucontext*)(ctx))->uc_mcontext.mc_gpr [(n)]) + #define UCONTEXT_REG_FPRn(ctx, n) (((os_ucontext*)(ctx))->uc_mcontext.mc_fpreg [(n)]) + #define UCONTEXT_REG_NIP(ctx) (((os_ucontext*)(ctx))->uc_mcontext.mc_srr0) + #define UCONTEXT_REG_LNK(ctx) (((os_ucontext*)(ctx))->uc_mcontext.mc_lr) #elif defined(_AIX) typedef ucontext_t os_ucontext;
Should this patch only be applied when PPC64 arch is used, or is this patch OK to have applied regardless of the system architecture? I haven't had time to look at the surrounding code to figure this out yet. Thanks!
(In reply to Mark Felder from comment #1) The patch applies to both PPC and PPC64.
Patch has been merged upstream: https://github.com/mono/mono/pull/11128