#5554: Strange interaction between "-osuf", profiling and TemplateHaskell
---------------------------------+------------------------------------------
Reporter: iustin | Owner:
Type: bug | Status: new
Priority: normal | Component: Template Haskell
Version: 7.2.1 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
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”.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5554>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs