
#11748: GHC runtime linker: fatal error: I found a duplicate definition for symbol -------------------------------------+------------------------------------- Reporter: jeiea | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.3 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * component: Compiler (Linking) => Template Haskell * architecture: x86_64 (amd64) => Unknown/Multiple Comment: The linker didn't change between `8.0.1` and `8.0.2`. I think this is a general limitation of TH. At least the current implementation. The linker is correct in saying you have a duplicate symbol. One is coming from the code that `inline-c` generates, which ends up producing a symbol called `rgb` (probably from the macro `RGB` in `windows.h`). The second comes from the `Win32` package. The `8.0.2` linker should have explicitly pointed these out. The issue is that TH uses a version of `Win32` that has all the symbols in the same object file. So the link has no choice but to load it all, even if you don't use `rgb` because it's in the same object file. If instead TH would use the archive instead of the `whole-package-as-object-file` variant then it should work. I'll leave this open so someone who knows more about TH can comment on the issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11748#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler