#7405: use of -no-hs-main causes TH compiles to fail
-------------------------+--------------------------------------------------
Reporter: MtnViewMark | Owner:
Type: bug | Status: new
Priority: normal | Component: Template Haskell
Version: 7.4.2 | Keywords:
Os: MacOS X | Architecture: x86
Failure: None/Unknown | Blockedby:
Blocking: | Related:
-------------------------+--------------------------------------------------
If you compile a project with -no-hs-main, so that you can (for example)
have a c based main that runs first, then you can't use template haskell,
as during compilation, the template haskell code fails to link and run.
What appears to happen is that the .c file with the "real main" gets
loaded (in order to have a main), but it fails to find the function it
will call as it is (directly, or transitively) dependent on the very
template haskell enabled .hs file being compiled.
The attached tar ball is a simple cabal based project that builds three
executables:
* plain-main - plain HS main, using a TH value
* c-no-th-main - c based main, calling into a HS function, no TH
* c-main - c based main, calling into a HS function that uses TH
The c-main program will fail to build, while the other two work
(demonstrating that the TH code is reasonable, and that the c main
function is reasonable.)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7405>
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