[MLton-user] SVN r6941 MLton/MinGW32 and FFI
Dan DuVarney
duvarney at reactive-systems.com
Tue Nov 11 12:40:45 PST 2008
Some good news:
After some work, I've been able to get the "iimport" example
(which uses makes FFI calls to "dlopen") to work. The steps required were:
1. I downloaded and installed a dlfcn library for MinGW from Google code.
2. Added "public" keywords to the _import directives in iimport.sml.
3. Add to Makefile: -target-lib-opt mingw -ldl
4. Since we didn't have a libm.dll, created a bogus one for testing
purposes.
5. After much pain, I discovered and fixed a bug in the dlfcn library. The
implementation of dlerror() was returning a pointer to a null
character on a
clean exit instead of a null pointer.
After these steps, the "iimport" example works correctly (although my "cos"
function returns x/2 instead of cos(x)).
I am now updating linkage-libdl.sml. Hopefully we will be up and running
with MLton once again.
-Dan
--
Dan DuVarney
Senior Software Engineer Reactive Systems Inc.
duvarney at reactive-systems.com +1 (919) 324-3507 ext. 103
OpenPGP (GnuPG) public key file:
http://www.reactive-systems.com/~duvarney/pgp_public_key.txt
More information about the MLton-user
mailing list