Strange interaction between "-osuf", profiling and TemplateHaskell
I see a strange behaviour of profiling + TemplateHaskell and the -osuf
option.
I'm trying to compile (any) TemplateHaskell code with profiling in the following way:
$ ghc --make -O example
[1 of 2] Compiling Th ( Th.hs, Th.o )
[2 of 2] Compiling Main ( example.hs, example.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Linking example ...
$ ghc --make -O -prof -auto-all -osuf .prof.o example
[1 of 2] Compiling Th ( Th.hs, Th.prof.o )
[2 of 2] Compiling Main ( example.hs, example.prof.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
ghc: ./Th.prof.o: unknown symbol `CCCS'
However, if in the second invocation the -osuf .prof.o
is changed to -osuf prof_o
, then everything works fine:
$ ghc --make -O -prof -auto-all -osuf .prof_o example
[1 of 2] Compiling Th ( Th.hs, Th.prof_o )
[2 of 2] Compiling Main ( example.hs, example.prof_o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Linking example ...
Sadly I don't know how to debug this, but it should be reproduceable with any TH code, with all of 6.12, 7.0.3 and 7.2.1.
If the .o
suffix is speciall (even in the form of .prof.o
), then it would be good to document this; the GHC doc says right now “you can choose any suffix that isn't the normal object suffix here”.
Trac metadata
Trac field | Value |
---|---|
Version | 7.2.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Template Haskell |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |