[GHC] #11495: TH_spliceE5_prof is failing with release candidate 8.0.1
GHC
ghc-devs at haskell.org
Tue Jan 26 17:16:10 UTC 2016
#11495: TH_spliceE5_prof is failing with release candidate 8.0.1
-------------------------------------+-------------------------------------
Reporter: thomie | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler | Version: 8.0.1-rc1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
`TH_spliceE5_prof` looks like this:
{{{
TH_spliceE5_prof::
$(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi
TH_spliceE5_prof*.dyn_o TH_spliceE5_prof*.dyn_hi TH_spliceE5_prof
'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make
-v0 TH_spliceE5_prof.hs -c
'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0
TH_spliceE5_prof.hs -prof -auto-all -osuf .p.o -o $@
./$@
}}}
In 4905b83a2d448c65ccced385343d4e8124548a3b, Simon added that
`$(ghcThWayFlags)` to the first compilation command. With a release
compiler, `ghcThWayFlags` defaults to `-dynamic`. But compiling with
`-dynamic` doesn't produce `.dyn_o` files (you need `-dynamic-too` for
that, which is enabled by `-XTemplateHaskell`, but **not** when compiling
with `-dynamic`), so the second compilation results in:
{{{
TH_spliceE5_prof.hs:8:17: fatal:
cannot find object file ‘./TH_spliceE5_prof_Lib.dyn_o’
while linking an interpreted expression
make[1]: *** [TH_spliceE5_prof] Error 1
*** unexpected failure for TH_spliceE5_prof(normal)
}}}
Not passing `-dynamic` fixes the test. But in the function `failNonStd` in
`compiler/ghci/Linker.hs` Simon suggests that passing `-dynamic`:
{{{
Cannot load -prof objects when GHC is built with -dynamic
To fix this, either:
(1) Use -fexternal-interprter, or
(2) Build the program twice: once with -dynamic, and then
with -prof using -osuf to set a different object file suffix.
}}}
Some ideas for a solution:
* change that message to not mention `-dynamic`
* always turn on `-dynamic-too` when `-XTemplateHaskell` is on, also when
using `-dynamic`
* find the place where `.dyn_o` is expected, and teach it that `.o` might
also be ok.
* make `-fexternal-interpreter` the default. Delete the test and a whole
bunch of other stuff.
It's all such a mess.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11495>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list