GHCi linker does not understand C++ exception tables on Windows
When compiling an executable that uses Template Haskell against a library that contains C++ code, GHC crashes:
[2 of 2] Compiling Main ( app\Main.hs, dist\build\main\main-tmp\Main.o )
ghc.exe: internal error: checkProddableBlock: invalid fixup in runtime linker: 0000000000360564
(GHC version 7.10.1 for x86_64_unknown_mingw32)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
I've boiled this down into a minimal reproduction of a library that includes a .cpp file, and an executable that depends on it. To test:
git clone https://github.com/lukexi/cxx-link-fail-repro
cabal run
The crash does not occur in the repro unless I use C++ exceptions in the library, and use Template Haskell in the executable, but in the project I boiled this down from (http://github.com/lukexi/bullet-mini) the problem occurs even with cc-options: -fno-exceptions.
Some more details are at https://github.com/lukexi/cxx-link-fail-repro
The platform is Windows 8.1 under MSYS2 (GHC is still using its inbuilt mingw). I've also tried 7.10.2-RC1 with the same result.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.10.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | #8237 (closed), #9297 (closed), #10563 (closed) |
| Blocking | |
| CC | ezyang, simonmar, thomie |
| Operating system | |
| Architecture |