[Mono-list] RE: [Mono-list] Canīt compile Mono on cygwin

Jan Gray jsgray@acm.org
Tue, 17 Jul 2001 14:11:39 -0400


I am curious about mono, and thought I'd give it a spin.

I have had two problems building mono-0.4, and a problem with the products
of the build.

(Setup: Windows 2000 SP2 with up to date Cygwin setup ("nothing to
install/update").)


1. In building glib as downloaded from
<ftp://ftp.gtk.org/pub/gtk/v1.2/glib-1.2.10.tar.gz>, there was an error in
gstrfuncs.c:

...
/bin/sh ./libtool --mode=compile
gcc -DHAVE_CONFIG_H -I. -I. -I. -DG_LOG_DOMAIN=g_log_domain_glib     -g -O2 
-Wall  -D_REENTRANT -c gstrfuncs.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -DG_LOG_DOMAIN=g_log_domain_glib -g -O2 -Wal
l -D_REENTRANT -c gstrfuncs.c -o gstrfuncs.o
gstrfuncs.c: In function `g_strsignal':
gstrfuncs.c:705: conflicting types for `strsignal'
/usr/include/string.h:70: previous declaration of `strsignal'
gstrfuncs.c:705: warning: extern declaration of `strsignal' doesn't match
global one
make[2]: *** [gstrfuncs.lo] Error 1
make[2]: Leaving directory `/downloads/cygwin/glib-1.2.10'
...

This change to gstrfuncs.c seemed to allow the glib build to finish:

*** gstrfuncs.c-0	Tue Jul 17 10:56:42 2001
--- gstrfuncs.c	Tue Jul 17 10:56:52 2001
***************
*** 703,705 ****

! #ifdef HAVE_STRSIGNAL
    extern char *strsignal (int sig);
--- 703,705 ----

! #if 0
    extern char *strsignal (int sig);

What is the proper way to build glib?


2. In building mono itself, interpreter/interp.c won't compile because it
#includes alloca.h.  My install of Cygwin does not provide an alloca.h.  I
fixed that as follows:

*** mono-0.4-0/mono/interpreter/interp.c	Tue Jul 17 11:19:52 2001
--- mono-0.4/mono/interpreter/interp.c	Tue Jul 17 11:21:34 2001
***************
*** 15,17 ****
--- 15,23 ----
  #include <glib.h>
+ #ifdef HAVE_ALLOCA_H
  #include <alloca.h>
+ #else
+ #ifdef __CYGWIN__
+ #define alloca __builtin_alloca
+ #endif
+ #endif

Should these patches be necessary?


3.  Now that it is built, I tried running mono-int and monodis against a
trivial assembly whose sole class's Main() consists of one bytecode, ret.
My build appears to SIGSEGV in load_metadata_ptrs, (assembly.c line 205), at
the strncmp() of raw_metadata and "BSJB".  GDB says the buffer returned by
mmap() in raw_buffer_load is an invalid address.  (However, the 'offset' and
'size' locals are correct.)  (Sorry if this is a red herring, I'm a GCC/GDB
newbie.)

Thanks for any advice.

Jan Gray, Gray Research LLC
jsgray@acm.org