Here's the patches that makes everything works...
patch-configure.in : this fixes pthread at several places and ensure LLVM_ 
variables have a sed -e to replace lpthread to pthread 
patch-eglib_src_Makefile.am : there's an issue with the NEED_VASPRINTF 
detection i commented the fix to keep foo.c  ; definitively not the place ... 
patch-mcs_class_System_System.IO_KeventWatcher.cs: old patch for keven from 
romain.tarti...@gmail.com mono maintainer (bsd-sharp)
patch-mono_dis_util.c : there's a problem with HAVE_ISINF detection ; flushed 
the pragma here... definitively not the place ... 

patch-mono_mini_mini-llvm.c : The important patch - mini-llvm.c contains 
gsharevt code and libmono-llvm.so doesn't link it, since it's just returning 
false, i readded the functions locally... also mono_print_unwind_info is not 
linked from unwind.o and adding it pull up recursive dependency...
I am including romain tartiere to keep him in the loop if he wants to check 
those patches in bsd-sharp repo...
I don't say those patches are ok, to the contrary, i say those a hints at what 
is to be really fixed for FreeBSD...
there's still code pointing to libc.so instead of @LIBC@
but this fix the issues:
ln -s /lib/libc.so.7 /lib/libc.so
Here's the sys info :

uname -a:FreeBSD pcbsd 11.0-CURRENT FreeBSD 11.0-CURRENT #10 r260825M: Thu Jan 
16 13:29:53 CST 2014     root@pcbsd:/usr/obj/usr/src/sys/GENERIC  amd64
mono --versionMono JIT compiler version 3.2.7 (master/738f9c3 Wed Jan 22 
14:21:09 CST 2014)Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and 
Contributors. www.mono-project.com        TLS:           __thread        
SIGSEGV:       altstack        Notification:  kqueue        Architecture:  
amd64        Disabled:      none        Misc:          softdebug        LLVM:   
       yes(3.4-mono-/)        GC:            sgen
clang --versionMono C# compiler version 3.2.7.0root@pcbsd:/ # clang 
--versionFreeBSD clang version 3.4 (tags/RELEASE_34/final 197956) 
20140101Target: x86_64-unknown-freebsd11.0Thread model: posix
llvm-config --version : 3.4-mono-/



Date: Wed, 22 Jan 2014 13:10:25 -0500
Subject: Re: [Mono-dev] llvm issue
From: kump...@gmail.com
To: brunola...@msn.com

We'd love to merge such change for FreeBSD :)

On Wed, Jan 22, 2014 at 12:24 PM, Bruno Lauzé <brunola...@msn.com> wrote:




Good news,  i figured out why it was hanging with llvm.
It's seems part of the code is missing -pthread and/or using -lpthread
CFLAGS+= -pthread
CXXFLAGS+= -pthreadLDFLAGS+= -pthread
it seems llvm-config output -lpthread and not -pthreadreplace -lpthread to 
-pthread in  LLVM_CFLAGSreplace -lpthread to -pthread in  LLVM_LIBS

I don't know if someone is willing to see this in mono source or to keep it as 
external patch?

Date: Tue, 21 Jan 2014 14:16:37 -0500
Subject: Re: [Mono-dev] llvm issue
From: kump...@gmail.com

To: brunola...@msn.com
CC: mono-devel-list@lists.ximian.com


LLVM was never tests on FreeBSD, you'll have to debug it.

On Tue, Jan 21, 2014 at 8:35 AM, Bruno Lauzé <brunola...@msn.com> wrote:





When I try to compile mono from git with llvm ; llvm installed from 
github.com/mono/llvm

I'm on FreeBSD HEAD.

Everything compiles smoothly but  now the mono-sgen process get stuck in 
"umtxn" state (kernel lock) on the first usage. (basic-profile-check.exe)

Whenever i remove --enable-llvm everything is fine again. This was working 
before around october. Any ideas what could have change to cause this?

Any suggestions where to look?


Thanks.                                           

_______________________________________________

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list



                                          

                                          

Attachment: patch-configure.in
Description: Binary data

Attachment: patch-eglib_src_Makefile.am
Description: Binary data

Attachment: patch-mcs_class_System_System.IO_KeventWatcher.cs
Description: Binary data

--- mono/dis/util.c.orig        2014-01-17 16:46:38.554823364 -0600
+++ mono/dis/util.c     2014-01-17 16:47:01.774755631 -0600
@@ -130,24 +130,7 @@
 int
 dis_isinf (double num)
 {
-#ifdef HAVE_ISINF
        return isinf (num);
-#elif defined(HAVE_IEEEFP_H)
-       fpclass_t klass;
-
-       klass = fpclass (num);
-       if (klass == FP_NINF)
-               return -1;
-
-       if (klass == FP_PINF)
-               return 1;
-
-       return 0;
-#elif defined(HAVE__FINITE)
-       return _finite (num) ? 0 : 1;
-#else
-#error "Don't know how to implement isinf for this platform."
-#endif
 }
 
 int
--- mono/mini/mini-llvm.c.orig  2014-01-22 11:02:34.000000000 -0600
+++ mono/mini/mini-llvm.c       2014-01-22 14:02:39.044979804 -0600
@@ -244,6 +244,25 @@
        return size;
 }
 
+static gboolean
+mini_llvm_is_gsharedvt_variable_type (MonoCompile *cfg, MonoType *t)
+{
+        return FALSE;
+}
+
+static gboolean
+mini_llvm_type_is_vtype (MonoCompile *cfg, MonoType *t)
+{
+    return MONO_TYPE_ISSTRUCT (t) || mini_llvm_is_gsharedvt_variable_type 
(cfg, t);
+}
+
+
+static gboolean
+mini_llvm_is_gsharedvt_klass (MonoCompile *cfg, MonoClass *klass)
+{
+        return FALSE;
+}
+
 /*
  * simd_class_to_llvm_type:
  *
@@ -1079,7 +1098,7 @@
                } else {
                        g_assert_not_reached ();
                }
-       } else if (cinfo && mini_type_is_vtype (ctx->cfg, sig->ret)) {
+       } else if (cinfo && mini_llvm_type_is_vtype (ctx->cfg, sig->ret)) {
                g_assert (cinfo->ret.storage == LLVMArgVtypeRetAddr);
                vretaddr = TRUE;
                ret_type = LLVMVoidType ();
@@ -1744,7 +1763,7 @@
                MonoInst *var = cfg->varinfo [i];
                LLVMTypeRef vtype;
 
-               if (var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) || 
mini_type_is_vtype (cfg, var->inst_vtype)) {
+               if (var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) || 
mini_llvm_type_is_vtype (cfg, var->inst_vtype)) {
                        vtype = type_to_llvm_type (ctx, var->inst_vtype);
                        CHECK_FAILURE (ctx);
                        /* Could be already created by an OP_VPHI */
@@ -1797,7 +1816,7 @@
        if (sig->hasthis)
                emit_volatile_store (ctx, cfg->args [0]->dreg);
        for (i = 0; i < sig->param_count; ++i)
-               if (!mini_type_is_vtype (cfg, sig->params [i]))
+               if (!mini_llvm_type_is_vtype (cfg, sig->params [i]))
                        emit_volatile_store (ctx, cfg->args [i + 
sig->hasthis]->dreg);
 
        if (sig->hasthis && !cfg->rgctx_var && cfg->generic_sharing_context) {
@@ -3441,7 +3460,7 @@
                                break;
                        }
 
-                       if (mini_is_gsharedvt_klass (cfg, klass)) {
+                       if (mini_llvm_is_gsharedvt_klass (cfg, klass)) {
                                // FIXME:
                                LLVM_FAILURE (ctx, "gsharedvt");
                                break;
@@ -4772,9 +4791,10 @@
         * with it.
         */
        cfg->encoded_unwind_ops = mono_unwind_decode_fde ((guint8*)data, 
&cfg->encoded_unwind_ops_len, NULL, &ei, &ei_len, &type_info, &this_reg, 
&this_offset);
+       /*
        if (cfg->verbose_level > 1)
                mono_print_unwind_info (cfg->encoded_unwind_ops, 
cfg->encoded_unwind_ops_len);
-
+       */
        /* Count nested clauses */
        nested_len = 0;
        for (i = 0; i < ei_len; ++i) {
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to