Bug 232060 - lang/mono: Fix for Mono build on FreeBSD PowerPC
Summary: lang/mono: Fix for Mono build on FreeBSD PowerPC
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Only Me
Assignee: freebsd-mono (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-08 01:06 UTC by Curtis Hamilton
Modified: 2019-05-10 18:41 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (mono)


Attachments
Patch to fix PowerPC build (818 bytes, text/plain)
2018-10-08 01:06 UTC, Curtis Hamilton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Hamilton 2018-10-08 01:06:38 UTC
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;
Comment 1 Mark Felder freebsd_committer freebsd_triage 2018-10-09 16:59:39 UTC
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!
Comment 2 Curtis Hamilton 2018-10-10 01:17:05 UTC
(In reply to Mark Felder from comment #1)
The patch applies to both PPC and PPC64.
Comment 3 Colin T. 2018-11-24 05:34:40 UTC
Patch has been merged upstream:
https://github.com/mono/mono/pull/11128