More work into making this compile on armish.

We are up to the point where it segfaults during build as some other arches
used to in the past... so somehow, this is an improvement ;-)
This commit is contained in:
ajacoutot 2009-09-22 17:55:23 +00:00
parent 253c3e293b
commit aef2e72389
4 changed files with 94 additions and 7 deletions

View File

@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.11 2009/09/06 07:25:27 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.12 2009/09/22 17:55:23 ajacoutot Exp $
ONLY_FOR_ARCHS= amd64 i386 powerpc
ONLY_FOR_ARCHS= amd64 i386 powerpc # arm
COMMENT= cross platform, open source .NET developement framework

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-configure,v 1.3 2009/09/22 11:19:37 ajacoutot Exp $
$OpenBSD: patch-configure,v 1.4 2009/09/22 17:55:23 ajacoutot Exp $
--- configure.orig Sat Aug 15 03:06:17 2009
+++ configure Mon Sep 21 23:43:54 2009
@@ -3013,8 +3013,11 @@ _ACEOF
@ -94,10 +94,10 @@ $OpenBSD: patch-configure,v 1.3 2009/09/22 11:19:37 ajacoutot Exp $
+ TARGET=ARM;
+ arch_target=arm;
+ ACCESS_UNALIGNED="no"
+ JIT_SUPPORTED=no
+ jit_wanted=no
+ INTERP_SUPPORTED=yes
+ interp_wanted=true
+ JIT_SUPPORTED=yes
+ jit_wanted=true
+ INTERP_SUPPORTED=no
+ interp_wanted=false
;;
s390-*-linux*)
TARGET=S390;

View File

@ -0,0 +1,74 @@
$OpenBSD: patch-mono_mini_exceptions-arm_c,v 1.1 2009/09/22 17:55:23 ajacoutot Exp $
--- mono/mini/exceptions-arm.c.orig Tue Sep 22 11:43:34 2009
+++ mono/mini/exceptions-arm.c Tue Sep 22 11:34:31 2009
@@ -12,7 +12,9 @@
#include <glib.h>
#include <signal.h>
#include <string.h>
+#if HAVE_UCONTEXT_H
#include <ucontext.h>
+#endif
#include <mono/arch/arm/arm-codegen.h>
#include <mono/metadata/appdomain.h>
@@ -83,6 +85,7 @@ typedef struct ucontext {
#if __APPLE__
#define my_ucontext ucontext_t
#else
+#ifdef MONO_ARCH_USE_SIGACTION
typedef struct my_ucontext {
unsigned long uc_flags;
struct my_ucontext *uc_link;
@@ -97,6 +100,7 @@ typedef struct my_ucontext {
*/
} my_ucontext;
#endif
+#endif
#define restore_regs_from_context(ctx_reg,ip_reg,tmp_reg) do { \
ARM_LDR_IMM (code, ip_reg, ctx_reg, G_STRUCT_OFFSET (MonoContext, eip)); \
@@ -455,6 +459,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTl
void
mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
{
+#ifdef MONO_ARCH_USE_SIGACTION
#if BROKEN_LINUX
struct ucontext *uc = sigctx;
@@ -469,11 +474,13 @@ mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext
mctx->ebp = UCONTEXT_REG_SP (my_uc);
memcpy (&mctx->regs, &UCONTEXT_REG_R4 (my_uc), sizeof (gulong) * 8);
#endif
+#endif
}
void
mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *ctx)
{
+#ifdef MONO_ARCH_USE_SIGACTION
#if BROKEN_LINUX
struct ucontext *uc = ctx;
@@ -488,6 +495,7 @@ mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *
UCONTEXT_REG_SP (my_uc) = mctx->ebp;
memcpy (&UCONTEXT_REG_R4 (my_uc), &mctx->regs, sizeof (gulong) * 8);
#endif
+#endif
}
/*
@@ -512,12 +520,14 @@ mono_arch_handle_exception (void *ctx, gpointer obj, g
gpointer
mono_arch_ip_from_context (void *sigctx)
{
+#ifdef MONO_ARCH_USE_SIGACTION
#if BROKEN_LINUX
struct ucontext *uc = sigctx;
return (gpointer)uc->uc_mcontext.gregs [ARMREG_PC];
#else
my_ucontext *my_uc = sigctx;
return (void*) UCONTEXT_REG_PC (my_uc);
+#endif
#endif
}

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-mono_mini_mini-arm_h,v 1.1 2009/09/22 17:55:23 ajacoutot Exp $
--- mono/mini/mini-arm.h.orig Tue Sep 22 11:43:58 2009
+++ mono/mini/mini-arm.h Tue Sep 22 11:34:25 2009
@@ -137,7 +137,9 @@ typedef struct MonoCompileArch {
#define ARM_FIRST_ARG_REG 0
#define ARM_LAST_ARG_REG 3
+#ifndef __OpenBSD__
#define MONO_ARCH_USE_SIGACTION 1
+#endif
#define MONO_ARCH_NEED_DIV_CHECK 1
#define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1