[Mono-dev] Mono runtime on ARM920t with many assertions

Dennis Krzyzaniak dkml at conworx.com
Fri Jun 1 10:29:53 UTC 2012

Hi all,


I am trying to get Mono running on a spider III device including an ARM920t
processor with Linux as OS.


/host $ uname -a

Linux Spider-III #1425 Fri Jul 25 10:59:30 CEST 2008
armv4tl unknown


When I try to invoke a simple hello_world.exe I get 399 assertions in eglib
(always the same asserts):


/host $ ./mono hello_world.exe

../../../../eglib/src/ghashtable.c:293: assertion 'hash != NULL' failed

../../../../eglib/src/ghashtable.c:236: assertion 'hash != NULL' failed

../../../../eglib/src/ghashtable.c:293: assertion 'hash != NULL' failed

../../../../eglib/src/ghashtable.c:236: assertion 'hash != NULL' failed



The 'Hello World' is also displayed:

../../../../eglib/src/ghashtable.c:293: assertion 'hash != NULL' failed

../../../../eglib/src/ghashtable.c:236: assertion 'hash != NULL' failed

Hello World../../../../eglib/src/ghashtable.c:293: assertion 'hash != NULL'



The hello world code:

using System;

namespace foobar {

   public class foo {

      public static void Main(string[] args) {

         Console.WriteLine("Hello World");





I am absolutely new to Mono and completely lost with this behavior. Maybe
someone knows the reason or can point me to a direction to find the issue?

I attached a trace (./mono -trace hello_world.exe), maybe this helps? The
trace is cut to fit into this mail, please let me know if a full trace is


I am using the debian source package of Mono 2_10_8.1-1 because in the
official release a unittest fails.

To get Mono build with the 'old' ARM  toolchain provided by the vendor I
made a few changes in the project please see below. 

I am calling configure with the following parameters:

configure  --build=i686-pc-linux-gnu --host=arm-axotec-linux-gnu
LD=arm-axotec-linux-gnu-ld OBJDUMP=arm-axotec-linux-gnu-objdump
--prefix=/host --disable-mcs-build --srcdir=../..





+dnl BEGIN Conworx Spider III ARMv4t settings

+dnl there are already arm-*-linux* settings below but the place is to late,
checks which

+dnl tested before fails. So I added my specific stuff here without changing
the old

+dnl settings.


+if test "x$host" = "xarm-axotec-linux-gnu"; then

+dnl looks like this are all needed settings, the rest is redundant.


+  cross_compiling=yes

+  dnl which defines are needed? just copied some


-mcpu=arm920t -D__ARM_ARCH_4__"


+  arch_target=arm;



+  jit_wanted=true

+  sgen_supported=true

+  dnl Can't use tls, since it depends on the runtime detection of tls

+  dnl  in mono-compiler.h

+  libgc_threads=pthreads

+  with_tls=pthread

+  use_sigposix=yes

+  dnl Enable support for using sigaltstack for SIGSEGV and

+  dnl stack overflow handling (TODO not sure if it works on my arm)

+  with_sigaltstack=no

+  dnl to bypass the underscore linker check, can't work when

+  mono_cv_uscore=yes

+  dnl support ahead of time compilation


+  libdl="-ldl"

+  dnl I need some define to enable my hacks oO

+  AC_DEFINE(PLATFORM_AXOTEC_LINUX,1,[Targeting axotec linux on arm920t])




+# Added LT_OUTPUT to generate libtool script by config.lt before calling


export_ldflags=`(./libtool --config; echo eval echo
\\$export_dynamic_flag_spec) | sh`



+dnl the check for cross compiling is included in the mono release but

+dnl in the debian source package because for the debian distribution no

+dnl compiling is used.

+if test ${TARGET} = ARM  && test x$cross_compiling = xno; then

   dnl ******************************************

   dnl *** Check to see what FPU is available ***

   dnl ******************************************






/* We dont store ip, sp */

#define ARCH_NUM_REGS 14

+/* arm920t does not support thumb2 instructions */

+#if !defined (NO_THUMB2_INSTRUCTIONS)

+/* THUMB2 instuctions */

#define ARCH_STORE_REGS(ptr)    \

   __asm__ __volatile__(         \

      "push {lr}\n"           \

@@ -145,6 +148,17 @@

      :                    \

      : "r" (ptr)             \



+/* ARM instuctions */

+#define ARCH_STORE_REGS(ptr) \

+   __asm__ __volatile__( \

+         "stmfd sp!, {lr}\n" \

+         "mov lr, %0\n" \

+         "stmia lr!, {r0-r12}\n" \

+         "ldmfd sp!, {lr}\n" \

+         : \

+         : "r" (ptr))







#if defined(__arm__) && MONO_ARCH_SOFT_FLOAT


+   /* ULLONG_MAX is not defined, just define here the max size of an

+    * long long int. */

+#ifndef ULLONG_MAX

+#define ULLONG_MAX   18446744073709551615ULL

+#endif /* !ULLONG_MAX */


   if (isnan (v) || !(v >= -0.5 && v <= ULLONG_MAX+0.5)) {

      mono_raise_exception (mono_get_exception_overflow ());



Would be great to get some help!



Best regards,

Dennis Krzyzaniak


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120601/70813727/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: helloworld_trace.txt
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120601/70813727/attachment-0001.txt>

More information about the Mono-devel-list mailing list