Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Nov 2009 15:31:30 GMT
From:      Justin Hibbits <chmeeedalf@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/140362: Patches for PowerPC support in mono
Message-ID:  <200911071531.nA7FVU8U052524@www.freebsd.org>
Resent-Message-ID: <200911071540.nA7Fe1SO059068@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         140362
>Category:       ports
>Synopsis:       Patches for PowerPC support in mono
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 07 15:40:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Justin Hibbits
>Release:        9-CURRENT
>Organization:
>Environment:
FreeBSD narn.knownspace 9.0-CURRENT FreeBSD 9.0-CURRENT #26 r198491M: Mon Oct 26 15:17:44 EDT 2009     root@narn.knownspace:/usr/obj/usr/src/sys/NARN  powerpc
>Description:
The attached patch adds PowerPC support to mono.  The patch is also being sent upstream.  Only thing not included in the patches is changing the ONLY_FOR_ARCHS line in the port makefile.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- configure.bak	2009-07-27 12:31:25.000000000 -0400
+++ configure	2009-11-07 10:17:11.000000000 -0500
@@ -2958,7 +2958,8 @@
 			LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
 			libmono_ldflags="$PTHREAD_LIBS"
 		fi
-		CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
+ 		CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD -DPLATFORM_BSD6 -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP"
+ 		libmono_cflags="$libmono_cflags -D_REENTRANT"
 		need_link_unlink=yes
 
 cat >>confdefs.h <<\_ACEOF
@@ -2972,7 +2973,7 @@
 # TLS is only partially implemented on -CURRENT (compiler support
 # but NOT library support)
 #
-		with_tls=pthread
+#		with_tls=pthread
 		;;
 	*-*-*openbsd*)
 		platform_win32=no
@@ -39414,8 +39415,8 @@
 INTERP_SUPPORTED=no
 LIBC="libc.so.6"
 INTL="libc.so.6"
-SQLITE="libsqlite.so.0"
-SQLITE3="libsqlite3.so.0"
+SQLITE="libsqlite.so.8"
+SQLITE3="libsqlite3.so.8"
 X11="libX11.so"
 
 sizeof_register="SIZEOF_VOID_P"
@@ -39675,7 +39676,7 @@
 		jit_wanted=true
 		;;
 	macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
-        powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* )
+        powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | powerpc-*-freebsd*)
 		if test "x$ac_cv_sizeof_void_p" = "x8"; then
 			TARGET=POWERPC64;
 			CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
--- mono/mini/mini-ppc.h.orig	2009-07-15 14:50:01.000000000 -0400
+++ mono/mini/mini-ppc.h	2009-11-07 10:22:09.000000000 -0500
@@ -281,6 +281,14 @@
 	#define UCONTEXT_REG_FPRn(ctx, n) ((ctx)->uc_mcontext.__fpregs.__fpu_regs [(n)])
 	#define UCONTEXT_REG_NIP(ctx)     _UC_MACHINE_PC(ctx)
 	#define UCONTEXT_REG_LNK(ctx)     ((ctx)->uc_mcontext.__gregs [_REG_LR])
+#elif defined(__FreeBSD__)
+#include <ucontext.h>
+	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)
 #else
 #error Unknown OS
 #endif


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911071531.nA7FVU8U052524>