Dynamic libraries by default and GHC 7.8

Max Bolingbroke batterseapower at hotmail.com
Thu Dec 6 10:27:55 CET 2012


On 27 November 2012 17:00, Ian Lynagh <ian at well-typed.com> wrote:
> We would love for Windows to be one of the platforms, but currently we
> can't do it on Windows. So unless that changes, Windows will not be one
> of the platforms, correct.

So if I understand correctly, the problem here arises because you
can't import from a DLL by *absolute path* but only by *relative
path*?

The tragedy here is that the Windows loader actually supports loading
from absolute paths natively, as an undocumented feature. If you build
a EXE and then hexedit the references to "library.dll" to absolute
paths "C:\library.dll" then your EXE will run completely correctly.

I'm not sure how to convince GNU ld to link us such a DLL, though. It
might be possible to hack it in by linking against
"verylongdummydllname.dll" and then having GHC search for that string
in DLL/EXE returned by LD and replace it by the null-terminated
absolute path.

Max



More information about the Glasgow-haskell-users mailing list