[MLton] Patch to build MLton on MinGW

Vesa Karvonen vesa.karvonen at cs.helsinki.fi
Mon Nov 27 02:37:49 PST 2006


Quoting Matthew Fluet <fluet at cs.cornell.edu>:
> > Below is the patch I'm currently using to build MLton on MinGW.
> 
> Just to be clear -- this patch shouldn't be necessary to build MLton on 
> MinGW.  Rather, it is a patch to get usable functionality out of MLNLFFI 
> generated code that uses the MLNLFFI Library.

Yes, that is correct.

> > The semantics of dlopen(NULL, /*...*/) seem difficult to emulate.
> 
> SML/NJ seems to have faked this issue by making the main lib NONE under a 
> Unix system and making it SOME "kernel32.dll" under a win32 system.

Yes, I noticed that.  I'm not sure whether that is a good idea.  Kernel32.dll
doesn't really correspond to the main program that dlopen(NULL, ...) returns.
It also doesn't contain the C runtime.  On Windows, SML/NJ's NLFFI library
seems to use GlobalAlloc and GlobalFree functions instead of malloc and free.

> Feel free to commit the patches.

Thanks.  I already commited the patch to memalloc-a4-unix.sml.  I'll massage
the patch to mingw.c a bit before commiting it.

-Vesa Karvonen



More information about the MLton mailing list