[MLton] MLNLFFI doesn't link on MinGW(?)

Vesa Karvonen vesa.karvonen at cs.helsinki.fi
Thu Nov 23 05:25:36 PST 2006


Quoting Vesa Karvonen <vesa.karvonen at cs.helsinki.fi>:
[...]
> Obviously libdl is missing (adding -ldl just complains that the library
> can not be found) so the dl* functions do not exist.  Does anyone know
> whether libdl is ported to MinGW?  However, what surprises me is that
> dl* calls are made even when I specify -linkage static.  I tried just
> replacing the dl* imports (in MLNLFFI source) into dummy (exception
> raising) functions, but then the executable failed dynamically (with an
> exception without exception history even with Exn.keepHistory true).

I finally got an exception history and saw that the dl* calls are made
from CMemAlloc (memalloc-a4-unix.sml), which uses them to get access to
malloc and free.  The source file also contained replacements that used
MLton's FFI to (statically) import malloc and free.  Is there some reason
why malloc and free must/should be obtained through dl* functions?

-Vesa Karvonen



More information about the MLton mailing list