[Pkg-mono-svn-commits] [SCM] moon branch, master, updated. upstream/2.3-52-g0458256

Jo Shields directhex at apebox.org
Fri Nov 5 23:04:04 UTC 2010


The following commit has been merged in the master branch:
commit 04582567bcb21cd1f80bdbad29f162986ae9bd57
Author: Jo Shields <directhex at apebox.org>
Date:   Fri Nov 5 22:45:35 2010 +0000

    Import mono.git's kfreebsd_support branch as much as possible (they're based on Mono 2.6.7, this is Mono 2.6.1) as a quilt patch

diff --git a/debian/patches/kfreebsd_support.patch b/debian/patches/kfreebsd_support.patch
new file mode 100644
index 0000000..dd96ced
--- /dev/null
+++ b/debian/patches/kfreebsd_support.patch
@@ -0,0 +1,258 @@
+diff --git a/mono-2-6/configure.in b/mono-2-6/configure.in
+index 0a9ed0f..2baa29e 100644
+--- a/mono-2-6/configure.in
++++ b/mono-2-6/configure.in
+@@ -116,6 +116,17 @@ case "$host" in
+ 		with_sigaltstack=no
+ 		use_sigposix=yes
+ 		;;
++	*-*-kfreebsd*-gnu)
++		platform_win32=no
++		CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -DTHREAD_LOCAL_ALLOC -pthread"
++		libmono_cflags="-D_REENTRANT -DTHREAD_LOCAL_ALLOC -pthread"
++		libmono_ldflags="-lpthread -pthread"
++		libdl="-ldl"
++		libgc_threads=pthreads
++		need_link_unlink=yes
++		with_sigaltstack=no
++		use_sigposix=yes
++		;;
+ 	*-*-*freebsd*)
+ 		platform_win32=no
+ 		if test "x$PTHREAD_CFLAGS" = "x"; then
+@@ -2212,6 +2223,11 @@ case "$host" in
+ 	LIBC="libc.so.12"
+ 	INTL="libintl.so.0"
+ 	;;
++     *-*-kfreebsd*-gnu)
++	LIBC="libc.so.0.1"
++	INTL="libc.so.0.1"
++	X11="libX11.so.6"
++	;;
+     *-*-*freebsd*)
+     	LIBC="libc.so"
+ 	INTL="libintl.so"
+diff --git a/mono-2-6/libgc/configure.in b/mono-2-6/libgc/configure.in
+index 2749d08..dd6e850 100644
+--- a/mono-2-6/libgc/configure.in
++++ b/mono-2-6/libgc/configure.in
+@@ -112,6 +112,17 @@ case "$THREADS" in
+ 	AC_DEFINE(THREAD_LOCAL_ALLOC)
+ 	THREADDLLIBS="-lpthread -lrt"
+ 	;;
++     *-*-kfreebsd*-gnu)
++	AC_DEFINE(GC_FREEBSD_THREADS)
++	INCLUDES="$INCLUDES -pthread"
++	THREADDLLIBS=-pthread
++	AC_DEFINE(_REENTRANT)
++	if test "${enable_parallel_mark}" = yes; then
++		AC_DEFINE(PARALLEL_MARK)
++	fi
++	AC_DEFINE(THREAD_LOCAL_ALLOC)
++	AC_DEFINE(USE_COMPILER_TLS)
++	;;
+       *-*-freebsd*)
+ 	AC_DEFINE(GC_FREEBSD_THREADS)
+ 	if test "x$PTHREAD_CFLAGS" != "x"; then
+diff --git a/mono-2-6/libgc/dyn_load.c b/mono-2-6/libgc/dyn_load.c
+index a6e3316..c8d6bed 100644
+--- a/mono-2-6/libgc/dyn_load.c
++++ b/mono-2-6/libgc/dyn_load.c
+@@ -26,7 +26,7 @@
+  * None of this is safe with dlclose and incremental collection.
+  * But then not much of anything is safe in the presence of dlclose.
+  */
+-#if defined(__linux__) && !defined(_GNU_SOURCE)
++#if (defined(__linux__) || defined(__GLIBC__)) && !defined(_GNU_SOURCE)
+     /* Can't test LINUX, since this must be define before other includes */
+ #   define _GNU_SOURCE
+ #endif
+@@ -386,7 +386,7 @@ GC_bool GC_register_main_static_data()
+ /* For glibc 2.2.4+.  Unfortunately, it doesn't work for older	*/
+ /* versions.  Thanks to Jakub Jelinek for most of the code.	*/
+ 
+-# if defined(LINUX) /* Are others OK here, too? */ \
++# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
+      && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+          || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) 
+ 
+diff --git a/mono-2-6/libgc/include/gc.h b/mono-2-6/libgc/include/gc.h
+index d77de30..7d84ebe 100644
+--- a/mono-2-6/libgc/include/gc.h
++++ b/mono-2-6/libgc/include/gc.h
+@@ -492,7 +492,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #   define GC_RETURN_ADDR (GC_word)__return_address
+ #endif
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+      && !defined(__ia64__)
+diff --git a/mono-2-6/libgc/include/private/gcconfig.h b/mono-2-6/libgc/include/private/gcconfig.h
+index d46e686..f16ee31 100644
+--- a/mono-2-6/libgc/include/private/gcconfig.h
++++ b/mono-2-6/libgc/include/private/gcconfig.h
+@@ -55,7 +55,7 @@
+ # endif
+ 
+ /* And one for FreeBSD: */
+-# if defined(__FreeBSD__) && !defined(FREEBSD)
++# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
+ #    define FREEBSD
+ # endif
+ 
+@@ -1307,8 +1307,15 @@
+ #	ifndef GC_FREEBSD_THREADS
+ #	    define MPROTECT_VDB
+ #	endif
+-#      define SIG_SUSPEND SIGTSTP
+-#      define SIG_THR_RESTART SIGCONT
++#       ifdef __GLIBC__
++#           define SIG_SUSPEND          (32+6)
++#           define SIG_THR_RESTART      (32+5)
++            extern int _end[];
++#           define DATAEND (_end)
++#       else
++#           define SIG_SUSPEND SIGTSTP
++#           define SIG_THR_RESTART SIGCONT
++#       endif
+ #	define FREEBSD_STACKBOTTOM
+ #	ifdef __ELF__
+ #	    define DYNAMIC_LOADING
+@@ -2053,6 +2060,28 @@
+ 	extern char * GC_FreeBSDGetDataStart();
+ #	define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
+ #   endif
++#   ifdef FREEBSD
++#	define OS_TYPE "FREEBSD"
++#	ifndef GC_FREEBSD_THREADS
++#	    define MPROTECT_VDB
++#	endif
++#	ifdef __GLIBC__
++#	    define SIG_SUSPEND		(32+6)
++#	    define SIG_THR_RESTART	(32+5)
++	    extern int _end[];
++#	    define DATAEND (_end)
++#	else
++#	    define SIG_SUSPEND SIGUSR1
++#	    define SIG_THR_RESTART SIGUSR2
++#	endif
++#	define FREEBSD_STACKBOTTOM
++#	ifdef __ELF__
++#	    define DYNAMIC_LOADING
++#	endif
++	extern char etext[];
++	extern char * GC_FreeBSDGetDataStart();
++#	define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
++#   endif
+ #   ifdef NETBSD
+ #	define OS_TYPE "NETBSD"
+ #	ifdef __ELF__
+@@ -2124,7 +2153,7 @@
+ #   define SUNOS5SIGS
+ # endif
+ 
+-# if defined(FREEBSD) && (__FreeBSD__ >= 4)
++# if defined(FREEBSD) && ((__FreeBSD__ >= 4) || (__FreeBSD_kernel__ >= 4))
+ #   define SUNOS5SIGS
+ # endif
+ 
+@@ -2187,7 +2216,7 @@
+ #   define CACHE_LINE_SIZE 32	/* Wild guess	*/
+ # endif
+ 
+-# ifdef LINUX
++# if defined(LINUX) || defined(__GLIBC__)
+ #   define REGISTER_LIBRARIES_EARLY
+     /* We sometimes use dl_iterate_phdr, which may acquire an internal	*/
+     /* lock.  This isn't safe after the world has stopped.  So we must	*/
+@@ -2268,7 +2297,7 @@
+ #if defined(SPARC)
+ # define CAN_SAVE_CALL_ARGS
+ #endif
+-#if (defined(I386) || defined(X86_64)) && defined(LINUX)
++#if (defined(I386) || defined(X86_64)) && (defined(LINUX) || defined(__GLIBC__))
+ 	    /* SAVE_CALL_CHAIN is supported if the code is compiled to save	*/
+ 	    /* frame pointers by default, i.e. no -fomit-frame-pointer flag.	*/
+ # define CAN_SAVE_CALL_ARGS
+diff --git a/mono-2-6/mono/mini/mini-amd64.h b/mono-2-6/mono/mini/mini-amd64.h
+index a48e968..6ee08f0 100644
+--- a/mono-2-6/mono/mini/mini-amd64.h
++++ b/mono-2-6/mono/mini/mini-amd64.h
+@@ -281,7 +281,7 @@ typedef struct {
+ 
+ #define MONO_ARCH_NOMAP32BIT
+ 
+-#elif defined (__FreeBSD__) || defined (__OpenBSD__)
++#elif defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__FreeBSD_kernel__)
+ 
+ #define REG_RAX 7
+ #define REG_RCX 4
+diff --git a/mono-2-6/mono/mini/mini-x86.h b/mono-2-6/mono/mini/mini-x86.h
+index 59545d4..b83c937 100644
+--- a/mono-2-6/mono/mini/mini-x86.h
++++ b/mono-2-6/mono/mini/mini-x86.h
+@@ -44,7 +44,7 @@ LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep);
+ 
+ #endif /* PLATFORM_WIN32 */
+ 
+-#if defined( __linux__) || defined(__sun) || defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__)
++#if defined( __linux__) || defined(__sun) || defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define MONO_ARCH_USE_SIGACTION
+ #endif
+ 
+@@ -150,7 +150,7 @@ typedef struct {
+ 	gboolean need_stack_frame;
+ } MonoCompileArch;
+ 
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+ # define SC_EAX sc_eax
+ # define SC_EBX sc_ebx
+ # define SC_ECX sc_ecx
+diff --git a/mono-2-6/mono/utils/mono-sigcontext.h b/mono-2-6/mono/utils/mono-sigcontext.h
+index bd888a6..c50d1d0 100644
+--- a/mono-2-6/mono/utils/mono-sigcontext.h
++++ b/mono-2-6/mono/utils/mono-sigcontext.h
+@@ -5,14 +5,14 @@
+ 
+ #if defined(__i386__)
+ 
+-#if defined(__FreeBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+ #include <ucontext.h>
+ #endif
+ #if defined(__APPLE__)
+ #include <AvailabilityMacros.h>
+ #endif
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	#define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_eax)
+ 	#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_ebx)
+ 	#define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_ecx)
+@@ -68,8 +68,21 @@
+ 
+ #elif defined(__x86_64__)
+ 
+-#ifdef __FreeBSD__
+-#define UCONTEXT_GREGS(ctx)	&(((ucontext_t*)(ctx))->uc_mcontext)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++	#define UCONTEXT_GREGS(ctx)	&(((ucontext_t*)(ctx))->uc_mcontext)
++	#define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rax)
++	#define UCONTEXT_REG_RBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rbx)
++	#define UCONTEXT_REG_RCX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rcx)
++	#define UCONTEXT_REG_RDX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rdx)
++	#define UCONTEXT_REG_RBP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rbp)
++	#define UCONTEXT_REG_RSP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rsp)
++	#define UCONTEXT_REG_RSI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rsi)
++	#define UCONTEXT_REG_RDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rdi)
++	#define UCONTEXT_REG_RIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rip)
++	#define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r12)
++	#define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r13)
++	#define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r14)
++	#define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r15)
+ #else
+ #define UCONTEXT_GREGS(ctx)	&(((ucontext_t*)(ctx))->uc_mcontext.gregs)
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index a5cd585..d0ccf8b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+kfreebsd_support.patch
 use_AC_PATH_PROGS_to_satisfy_chromium_search.patch
 use_bundled_mono_runtime_for_smcs.patch
 include_config.h_in_all_files.patch

-- 
moon



More information about the Pkg-mono-svn-commits mailing list