#4899: Non-standard compile plus Template Haskell produces spurious "unknown
symbol" linker error
-------------------------------------------+--------------------------------
Reporter: jepst | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone: 7.4.1
Component: Compiler | Version: 7.0.1
Keywords: template link prof dynamic | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC rejects valid
program
-------------------------------------------+--------------------------------
Changes (by simonpj):
* owner: => simonmar
Comment:
Jeff's script is wrong. The desired thing is
* `ghc --make Main`
* `ghc --make -prof -osuf p_o -hisuf p_hi`
and he wasn't doing that.
* The error message didn't make it clear that's what to do
* There was no mention of `hisuf`, which is bad
However there is something deeper wrong. When compiling a TH splice
`$(Foo.f 3)` with `-prof`, we compile the byte-code non-profiled, and link
against the ''non-profiled'' `Foo.o`. But which hi file will we use for
`Foo`. Really we should use `Foo.hi` for the TH stuff and `Foo.p_hi` for
the stuff outside TH splices. But GHC has no mechanism for two
simultaneous interface files!
It probably just about works at the moment because TH only uses the types
of exported symbols, which don't really vary between `.p_hi` and `.hi`
files. The ice is pretty thin though.
We'd also like a better error report for when you link against a `.o` file
that (say) was compiled with profiling. `ghc: ./Bug1.o: unknown symbol
era` doesn't help much!
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4899#comment:2>
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