Sorry, wrong mailing list. ---------- Forwarded message ---------- From: Jeremy Teo <[EMAIL PROTECTED]> Date: Jun 28, 2005 12:58 AM Subject: Building mono on Solaris 10 x86/x64 : What I did, with patches To: mono-list@lists.ximian.com
Hi folks, After a whole weekend of ugly hackey, I managed to get mono 1.1.8.1 to build and run on Solaris 10 x86/x64. It fails some tests though, but it seems good enough to build and run GtkDemo.exe from gtk-sharp. Oh and of course i managed to build gtk-sharp on the same environment. Without much further ado, this is what I did. 1) Must build with --with-tls=pthreads on Solaris x86/x64 ie. configure must be called with "--with-tls=pthreads" I would appreciate it if someone who knows how to hack autotools make this the default for Solaris 10 x64? 2) Don't set FILE_OFFSET_BITS to 64 The current configure script sets FILE_OFFSET_BITS to 64, but on Solaris, this is only allowed if you're compiling for ILP64 (i'm no expert, but this means 64bit code. eg. -m64 for gcc?) 3) The bundled gc (boehm garbage collector) doesn't build. I suspect this is due to the build system again. I worked around this by building boehm gc version 6.3alpha1 (which is identical to what you folks bundle in the tarball), and specifying "--with-gc=boehm". 4) libtool is generated wrongly / configured wrongly. On Solaris 10, gcc uses the system linker, also named "ld". In order to generate shared libraries, the proper flag to pass to gcc (which then passes it to the system linker) is "-Wl,-G", not "-shared" as on other platforms. I hacked this manually in the generated libtool. 5) The shared library for libc is libc.so.1 For the "config" file found in data/config, libc should be set to libc.so.1 for Solaris, instead of libc.so.6 Is this autogenerated? Can someone in the know fix this? (or teach me how :) ) 6) The filepath to install-sh for the mcs subtree is wrong The various Makefiles in the mcs subtree try to call "./install-sh", which obviously fails since install-sh is in the top source directory. I hacked around this by setting $INSTALL correctly in config.make. 7) exceptions-x86.c had to be patched. Patch is attached to this email. 8) socket-io.c had to be patched Patch is attached to this email. Probably not correct, but works for now. 9) mph.h had to be patched Patch is attached. Could someone explain to me the significance of defining MPH_INTERNAL? Thank you all again for your work. :) I would be happy to work with you folks to make Mono build cleanly and pass all the tests on Solaris 10. (incidentally, once it does, i will package it for www.blastwave.org. Testers are welcome too.) -- Regards, Jeremy -- Regards, Jeremy
--- /export/home/nerant//mybuild/src/orig/mono-1.1.8.1/mono/mini/exceptions-x86.c Mon Apr 11 22:16:27 2005 +++ ./mono-1.1.8.1/mono/mini/exceptions-x86.c Sun Jun 26 15:43:37 2005 @@ -551,8 +551,10 @@ mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *mctx) { #ifdef MONO_ARCH_USE_SIGACTION - ucontext_t *ctx = (ucontext_t*)sigctx; - + #ifndef sun + ucontext_t *ctx = (ucontext_t*)sigctx; + #endif + #if defined(__FreeBSD__) mctx->eax = ctx->uc_mcontext.mc_eax; mctx->ebx = ctx->uc_mcontext.mc_ebx; @@ -563,6 +565,19 @@ mctx->esi = ctx->uc_mcontext.mc_esi; mctx->edi = ctx->uc_mcontext.mc_edi; mctx->eip = ctx->uc_mcontext.mc_eip; + +#elif defined(sun) + struct sigcontext *ctx = (struct sigcontext *)sigctx; + mctx->eax = ctx->SC_EAX; + mctx->ebx = ctx->SC_EBX; + mctx->ecx = ctx->SC_ECX; + mctx->edx = ctx->SC_EDX; + mctx->ebp = ctx->SC_EBP; + mctx->esp = ctx->SC_ESP; + mctx->esi = ctx->SC_ESI; + mctx->edi = ctx->SC_EDI; + mctx->eip = ctx->SC_EIP; + #else mctx->eax = ctx->uc_mcontext.gregs [REG_EAX]; mctx->ebx = ctx->uc_mcontext.gregs [REG_EBX]; @@ -593,8 +608,10 @@ mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *sigctx) { #ifdef MONO_ARCH_USE_SIGACTION - ucontext_t *ctx = (ucontext_t*)sigctx; - + #ifndef sun + ucontext_t *ctx = (ucontext_t*)sigctx; + #endif + #if defined(__FreeBSD__) ctx->uc_mcontext.mc_eax = mctx->eax; ctx->uc_mcontext.mc_ebx = mctx->ebx; @@ -606,6 +623,18 @@ ctx->uc_mcontext.mc_edi = mctx->edi; ctx->uc_mcontext.mc_eip = mctx->eip; +#elif defined(sun) + struct sigcontext *ctx = (struct sigcontext *)sigctx; + mctx->eax = ctx->SC_EAX; + mctx->ebx = ctx->SC_EBX; + mctx->ecx = ctx->SC_ECX; + mctx->edx = ctx->SC_EDX; + mctx->ebp = ctx->SC_EBP; + mctx->esp = ctx->SC_ESP; + mctx->esi = ctx->SC_ESI; + mctx->edi = ctx->SC_EDI; + mctx->eip = ctx->SC_EIP; + #else ctx->uc_mcontext.gregs [REG_EAX] = mctx->eax; ctx->uc_mcontext.gregs [REG_EBX] = mctx->ebx; @@ -636,9 +665,14 @@ mono_arch_ip_from_context (void *sigctx) { #ifdef MONO_ARCH_USE_SIGACTION - ucontext_t *ctx = (ucontext_t*)sigctx; + #ifndef sun + ucontext_t *ctx = (ucontext_t*)sigctx; + #endif #if defined(__FreeBSD__) return (gpointer)ctx->uc_mcontext.mc_eip; +#elif defined(sun) + struct sigcontext *ctx = sigctx; + return (gpointer)ctx->SC_EIP; #else return (gpointer)ctx->uc_mcontext.gregs [REG_EIP]; #endif
--- /export/home/nerant/mybuild/src/orig/mono-1.1.8.1/mono/metadata/socket-io.c Sun Jun 19 12:20:39 2005 +++ ./mono-1.1.8.1/mono/metadata/socket-io.c Sun Jun 26 15:53:14 2005 @@ -1853,9 +1853,11 @@ return (ptr [0] == 127); } #ifdef AF_INET6 + #ifndef sun else { - return (IN6_IS_ADDR_LOOPBACK (ptr)); + return (IN6_IS_ADDR_LOOPBACK ((struct in6_addr *) ptr)); } + #endif #endif return FALSE; }
--- /export/home/nerant//mybuild/src/orig/mono-1.1.8.1/support/mph.h Wed Jun 1 08:23:52 2005 +++ ./mono-1.1.8.1/support/mph.h Sun Jun 26 15:48:05 2005 @@ -42,7 +42,11 @@ #endif #ifdef __GNUC__ -#define MPH_INTERNAL __attribute__((visibility("hidden"))) + #ifndef sun + #define MPH_INTERNAL __attribute__((visibility("hidden"))) + #else + #define MPH_INTERNAL + #endif #else #define MPH_INTERNAL #endif
_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list