Patches for CYGWIN, was Re: [Mono-list] Jit compiler

David Dawkins david@dawkins.st
Thu, 20 Dec 2001 13:42:22 -0000


Make this patch to mono/metadata/image.c:

- Replace the  fopen() call in do_mono_image_open() with:
#if defined(__CYGWIN__)
    image->f  = fopen (fname, "rb");   /* open binary */
#else
    image->f  = fopen (fname, "r");
#endif

This will stop CRLF conversion; I'm guessing your cygwin
filesystem is mounted as "textmode" (type "mount").

You'll probably need to disable the mmap() call in rawbuffer.c
too:

- Replace the call to mmap() with the following:

#if defined(__CYGWIN__)
 mmap_ptr = (char *) -1;
#else
 mmap_ptr = mmap (0, end - start, prot, flags, fd, start);
#endif

Someone else logged this issue, check out the list archives
for September (Sep 29th?). Seems there's a bug in mmap() still.

Rebuild everything, and see how far this gets you.

How do we get these patches applied, or at least reviewed?

Regards,
David

----- Original Message -----
From: "adc" <shark@blueyonder.co.uk>
To: <mono-list@ximian.com>
Sent: Thursday, December 20, 2001 1:16 PM
Subject: [Mono-list] Jit compiler


> Hi,
>  I have downloaded the latest anonCVS and I am trying to run the
disassembler on some of the tests in the tests directory. Once I have
compiled these with the Microsoft C# compiler I execute, for example
> ./monodis ../tests/ackermann.exe
>
> but I recieve an error about an assertion in loader.c at line 73.
> This assertion asserts that the assembly has been opened without error
(which it obviously hasn't) the error appears to be happening in the
mono_image_open function in image.c. This seems to happen with every
executable I throw at it, even extremely simple programs.
>
> Do we have some tests CLI executables which are loaded by the metadata
library somewhere that I can get my hands on?
>
> I ask as for my disertation I am going to investigate the worthiness of
writing an assembler from CIL executables to native code executables, what
optimisations etc can be gained by the fact that we no longer have
compilation speed as a major restriction (obviously we don't want a compiler
that takes forever but it would then be of less concern).
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list