creating a library from haskell files and a c wrapper in Linux

Simon Marlow simonmar@microsoft.com
Tue, 10 Sep 2002 17:11:43 +0100


> Speaking solely from the gcc side, if you can capture all the=20
> compilation=20
> commands, add "-PIC", and then grab the ld flags and change=20
> the options=20
> there, everything should work.  This is, obviously, not=20
> terribly convenient=20
> but anything that links as a binary should work as a shared=20
> library as well. =20
> Simon, am I missing something?

Yes :-)  -fPIC doesn't work for the code generated by GHC.    You can =
make shared libraries without -fPIC, but that also imposes constraints =
on the code, constraints which the code generated by GHC doesn't satisfy =
at the moment.  I can't remember the exact details, but John Levine's =
Linker book is a good place to start.

Cheers,
	Simon