[Mono-dev] Mono (C#) on Solaris10/x86
Guenter Feldmann
fld at informatik.uni-bremen.de
Tue Jan 23 08:15:35 EST 2007
Am Montag 22 Januar 2007 15:12 schrieb Paolo Molaro:
> On 01/15/07 Guenter Feldmann wrote:
> > 1) Install Boehm GC 7.0alpha7. The stable versions 6.x don't work with Solaris x86!
>
> It would be nice to backport the necessary changes to the 6.x versions.
>
> > 4) apply patch to mono/mini/mini-exceptions.c.
>
> Please post the result of (svn) diff -u, thanks.
--- mini-exceptions.c.orig 2007-01-12 13:32:20.000000000 +0100
+++ mini-exceptions.c 2007-01-12 16:28:00.000000000 +0100
@@ -32,6 +32,10 @@
#include "mini.h"
#include "trace.h"
+#ifdef sun
+#include <thread.h>
+#endif
+
#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
#include <unistd.h>
#include <sys/mman.h>
@@ -917,6 +921,10 @@
pthread_attr_t attr;
size_t stsize = 0;
struct sigaltstack sa;
+#ifdef sun
+ stack_t ss;
+ int res;
+#endif
guint8 *staddr = NULL;
guint8 *current = (guint8*)&staddr;
@@ -930,24 +938,28 @@
#else
#ifdef HAVE_PTHREAD_ATTR_GET_NP
pthread_attr_get_np( self, &attr );
-#elif defined(sun)
- pthread_attr_getstacksize( &attr, &stsize );
-#else
+#elif !defined(sun)
#error "Not implemented"
#endif
#endif
-#ifndef sun
+#ifdef sun
+ res = thr_stksegment(&ss);
+ g_assert (res == 0);
+
+ stsize = ss.ss_size;
+ tls->end_of_stack = ss.ss_sp;
+#else
pthread_attr_getstack( &attr, (void**)&staddr, &stsize );
-#endif
pthread_attr_destroy (&attr);
g_assert (staddr);
-
+
g_assert ((current > staddr) && (current < staddr + stsize));
tls->end_of_stack = staddr + stsize;
+#endif
/*
* threads created by nptl does not seem to have a guard page, and
More information about the Mono-devel-list
mailing list