[Mono-devel-list] Add /addmodule: support to mcs

Varga Zoltan vargaz at freemail.hu
Mon Dec 22 09:28:55 EST 2003


                                            Hi,

   The CVS version of mcs now supports /target:module and
/addmodule.
Please try it out and report any bugs you may encounter.

           bye

                 Zoltan

Peter Ross <pro at missioncriticalit.com> írta:

> On Thu, Dec 18, 2003 at 12:55:45PM +0100, Paolo Molaro wrote:
> > On 12/18/03 Peter Ross wrote:
> > > > 
> > > > > I was wondering if anyone can give me any pointers
on what would need to
> > > > > be done to add /addmodule support to mcs?
> > [...]
> > > My plan is to look at monodis, factor out some of the
code into a
> > > library, build a .NET assembly above the library using
PInvoke and then
> > > integrate the library into mcs.
> > 
> > The library already exists, the code is in metadata/.
> > 
> Thanks.
> 
> > > Why am I doing this?  I would like to get Mercury [1]
building under
> > > Mono, and for that I need a C# compiler that accepts
/addmodule and a
> > > minimal implementation of al.exe.
> > 
> > Didn't the mercury compiler generate IL code? Or does it
generate both
> > IL and C# code?
> > 
> The compiler generates IL, but one can also specify that the
> implementation of a function is in a foreign language.  We
use this to
> do some of the low level stuff (IO, sockets, etc., etc.)
is in the
> standard library.  Thus some of the mercury standard
library is written
> in C#, which is placed into modules, which are then linked
together by
> al.exe to form the assembly mercury.dll.
> 
> 
> > I think the way to go is to implement the
Assembly::LoadModule()
> > method. It may be that the MS runtime already supports
the kind of use
> > we need to implement /addmodule.
> > Anyway, the implementation of the method should work in
the context of
> > an AssemblyBuilder: when mcs creates the
Assemblybuilder, it just
> > uses abuilder.LoadModule (...) for each /addmodule argument.
> > The loaded module gets added to the modules for the
assembly builder
> > and things should mostly work ok, but no doubt some
changes will be
> > needed, both when doing type lookups and when writing
the pe file...
> > al.exe, I think, could be implemented with the same trick.
> > Alternatively, al.exe could be probably written using
PEAPI.dll
> > instead of Reflection.Emit.
> > Another related (but minor) issue is getting mcs to
create modules:
> > we can probably overload the assembly builder flags to
add a Module
> > item, so Reflection.Emit will emit a module instead of a
full assembly
> > in that case.
> > 
> Thanks for this tips, I will look further into this.
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 
> 







More information about the Mono-devel-list mailing list