[Haskell] building shared objects

Jeremy Wazny jeremywazny at yahoo.com.au
Wed Sep 20 07:32:23 EDT 2006

Hi Bulat,

> Thursday, September 14, 2006, 7:45:46 PM, you wrote:
> > I'm wondering if anybody has had any success building shared
> objects
> > from Haskell code on x86 Linux and/or Sparc Solaris.
> from GHC docs:
> "-dynamic
> Tell the linker to use shared Haskell libraries, if available (this
> option is only supported on Mac OS X at the moment, and also note
> that
> your distribution of GHC may not have been supplied with shared
> libraries)"

Unfortunately I need this to work on x86 Linux and Sparc Solaris (and
possibly x86 Solaris.) 
GHC's -fPIC flag also won't work for the same reason.

> may be it's possible to use yhc or jhc?

I don't think yhc supports "foreign export".
I briefly considered hacking yhi so that I can link it, and some
pre-compiled bytecode, directly into the shared library, but I'm not
confident I could come up with something reliable.

I've just tried building jhc (from the darcs repository), but the
libraries ("base-1.0.hl", to be specific) fail to build.

Really, I was hoping that even if there isn't a completely standard
solution, it would not take much more than just rebuilding some
libraries. Trying to get GHC to compile and use unregisterised
libraries still seems like the least hacky approach, but I haven't had
any success in that direction.



On Yahoo!7 
360° new features: Blog polls, visitor stats custom themes and more! 

More information about the Haskell mailing list