how to get ghci to load compiled modules in 7.8?

Evan Laforge qdunkan at
Mon Jul 14 19:35:13 UTC 2014

On Mon, Jul 14, 2014 at 11:13 AM, Evan Laforge <qdunkan at> wrote:
> On Mon, Jul 14, 2014 at 10:36 AM, Reid Barton <rwbarton at> wrote:
>> See The current workaround for
>> GHC 7.8 is to compile with -dynamic, not -dynamic-too.
> That was it!  Thanks so much.

Actually... not quite.  -dynamic seems let ghci load, but when I load
with the GHCI API, I get this:

compile error: <interactive session>:
    cannot find normal object file ‘build/debug/obj/Util/Contro.o’
    while linking an interpreted expression

The proper name is 'Control.hs.dyn_o', so it looks like the suffix
mangling code is getting confused.  I must be doing something
different than ghci anyway, because I have to pass -dynamic in the
GHCI API to load, while ghci doesn't seem to need it.  And of course
ghci doesn't get the mangled filename.  One thing is that I'm using
'-osuf .hs.o', which is a bit confusing, since it should actually be
'.hs.o_dyn', but there's no -odynsuf and I don't really know how all
the name mangling in there works.

I'll take a look in the ghci code to see how it's doing things.

More information about the Glasgow-haskell-users mailing list