[m-dev.] IL, Mono and Portable .NET

Jonathan Morgan jonmmorgan at gmail.com
Sun Feb 26 21:09:19 AEDT 2006


On 2/26/06, Peter Ross <pro at missioncriticalit.com> wrote:
>
> On Sun, Feb 26, 2006 at 12:31:06AM +1100, Jonathan Morgan wrote:
> >
> >    An update on the status of DotGnu/Mono and the Mercury IL backend.
> >    I have tried the patches with both DotGnu and Mono on Win32, and also
> >    with Mono on Linux (DotGnu is already being covered by Julien on
> >    Linux).  Both DotGnu and Mono have a C# compiler (cscc/mcs), a IL
> >    compiler (ilasm) and a linker (ilalink/al).  Neither have a Managed
> >    C++ compiler, which we'll have to look into after we convince the C#
> >    to compile.  It can probably be cut out as unnecessary.
>
> The managed C++ compiler should be unnecessary, I think I've removed
> all the managed C++ from inside the library and runtime.  If not it's
> just a matter of translating from C++ to C#.


It is removed from the library/runtime (though some of the runtime seems to
be defined only in an MC++ header, as #defines).  However, *__cpp_code.o
should still be in the dependencies, meaning that make should still try to
build them, and fail.

>    DotGnu does not have the /addmodule: option to cscc, but instead it
> >    has a -fmodule= option.
> >    mcs supports all Microsoft csc type flags, as well as GNU type flags
> >    (eg. /addmodule: and -addmodule and --addmodule)
> >    DotGnu fails to build because it cannot find the mercury namespaces
> >    (eg. mercury.runtime.*).
>
> Does the runtime assembly build?  ie do you have a mercury_dotnet.dll
> and mercury_il.dll in the runtime directory.


Yes, for both DotGnu and Mono.

>    Mono crashes completely with the following error messages:
> >    ** (C:/Programs/Programming/Mono-[1]
> >    1.1.12.1/lib/mono/1.0/mcs.exe:2312): WARNING **: The following
> >    assembly referenced from
> >    C:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\bool.dll
> >    could not be loaded:
> >         Assembly:   mercury    (assemblyref_index=0)
> >         Version:    [2]0.0.0.0
> >         Public Key: 228c167d12aa0b0b
> >    The assembly was not found in the Global Assembly Cache, a path
> listed
> >    in the MONO_PATH environment variable, or in the location of the
> >    executing assembly (.).
> >    **
> >    (C:/Programs/Programming/Mono-[3]1.1.12.1/lib/mono/1.0/mcs.exe:2312):
> >    WARNING **: The class mercury.bool.bool_0 could not be loaded, used
> in
> >    mercury, Version= [4]0.0.0.0, Culture=neutral,
> >    PublicKeyToken=228c167d12aa0b0b
> >    This application has requested the Runtime to terminate it in an
> >    unusual way.
> >    Please contact the application's support team for more information.
> >    Obviously it is unable to realise that it is in the middle of
> building
> >    the mercury assembly it is referencing.
>
> Yes it is trying to load the mercury assembly of which in the end
> bool.dll is part of.


Obviously this partial assembling is a feature of MS csc - should it really
be?  It may be useful for building arcane applications like Mercury, but
could not this building be done by referencing assemblies, rather than
modules?

>    Both Mono and DotGnu ilasm appear to try to build assemblies rather
> >    than modules, so that MS csc complains that it should reference the
> >    resultant DLLs rather than including them.  I tried building the IL
> >    library with MS ilasm to see if this was the problem, but the same
> >    errors occurred in cscc/mcs.  The problem appears to be that neither
> >    them are able to find the namespace or the assembly mercury, as it is
> >    in the middle of being built.
> >    Any suggestions as to what to do next?
>
> It still works and builds using the MS tools?  One way to continue
> further would be to build the first copy of mercury.dll using these
> tools and then see if you can get further.


It will not build with MS csc, because Mono/DotGnu ilasm appear to build
assemblies, rather than modules.  However, it would work if you used /R:
(reference assembly) rather than /addmodule: (note that this fix would not
work with mcs/cscc).

My only suggestion is to build a small example of what you are trying to
> do and the post it to the Mono and DotGNU mailing lists and see what
> help you can get there.
>

I'll have a look into it.

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/developers/attachments/20060226/eb152cc5/attachment.html>


More information about the developers mailing list