Allow Template Haskell to be used with -prof
authorSimon Marlow <simonmar@microsoft.com>
Wed, 21 Jun 2006 11:04:36 +0000 (11:04 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 21 Jun 2006 11:04:36 +0000 (11:04 +0000)
commit6f5d77444aec9d84d9af59315c6c7885de33ed55
tree1337d9db7002cbb07e9491a30bb29827eac463d7
parent42a28f9df94148e713f34e229f5a636ca203f84b
Allow Template Haskell to be used with -prof

In order for this to work, you need to build the program first in the
normal way (without -prof), and then again with -prof and a suitable
-osuf (eg. -osuf p_o).  The compiler will pick up the object files
from the normal way for running TH expressions, when it sees -prof
together with -osuf.  If you omit the -osuf, you get an error message:

TH_genEx.hs:12:2:
    Dynamic linking required, but this is a non-standard build (eg. prof).
    You need to build the program twice: once the normal way, and then
    in the desired way using -osuf to set the object file suffix.

If you use -osuf, but haven't built the program the normal way first,
then you see:

TH_genEx.hs:12:2:
    cannot find normal object file `TH_genExLib.o'
    while linking an interpreted expression

Documentation to follow.

Fixes: #651
compiler/ghci/Linker.lhs
compiler/main/HscMain.lhs