24 Sep
2006
24 Sep
'06
8:23 p.m.
On Sun, 24 Sep 2006 21:37:32 +0300, Anatoly Zaretsky wrote:
ghc -Wall -optl "-shared" -o libtestffi.so \ hsinit.c testffi.o testffi_stub.o
Ok, that is even shorter. And it seems you don't have to call hs_add_root() or hs_exit(). At least for me it works with this hsinit.c: #include <HsFFI.h> static void __attribute__ ((constructor)) my_init(void) { hs_init(0, 0); } I put everything I've figured out so far on my wiki: http://stephan.walter.name/Overriding_shared_libraries_with_Haskell Warning: I'm a complete Haskell newbie, but I appreciate comments! -Stephan