[Haskell-cafe] GHC linker error 8.8.4 Windows

Sylvain Henry sylvain at haskus.fr
Tue Nov 17 13:41:34 UTC 2020


Hi,

On Windows, GHC embeds GMP (the C library) directly into the integer-gmp 
package. So you mustn't try to link against another libgmp library to 
avoid duplicated symbol errors (as the one you've got).

It may be that you have a dependency of this specific test (or the test 
itself) that has the following stanza in its Cabal file: 
"extra-libraries: gmp"

Regards,
Sylvain


On 17/11/2020 13:20, Sumit Raja wrote:
> Hi,
>
> Suddenly started getting the following linker error after I moved code 
> around in my project. It only seems to occur when I am building one 
> specific cabal test target. When building a dependent build it build 
> successfully but cabal repl test-xxx fails. I have no consistent way 
> to repro but I will keep trying and file a defect..
>
> GHCi, version 8.8.4: https://www.haskell.org/ghc/  :? for help
> GHC runtime linker: fatal error: I found a duplicate definition for symbol
>    __gmpn_sec_sqr_itch
> whilst processing object file
>    C:\Users\sumit\Apps\ghc-8.8.4\mingw\lib\libgmp.dll.a
> The symbol was previously defined in
>  C:\Users\sumit\Apps\ghc-8.8.4\lib\integer-gmp-1.0.2.0\HSinteger-gmp-1.0.2.0.o
> This could be caused by:
>    * Loading two different object files which export the same symbol
>    * Specifying the same object file twice on the GHCi command line
>    * An incorrect `package.conf' entry, causing some object to be
>      loaded twice.
> ghc.exe: panic! (the 'impossible' happened)
>   (GHC version 8.8.4 for x86_64-unknown-mingw32):
>         loadArchive 
> "C:\\Users\\sumit\\Apps\\ghc-8.8.4\\mingw\\lib\\libgmp.dll.a": failed
>
> Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
>
> CallStack (from HasCallStack):
>   die', called at 
> .\\Distribution\\Client\\ProjectOrchestration.hs:1041:55 in 
> main:Distribution.Client.ProjectOrchestration
> cabal.exe: repl failed for mkr-txn-0.1.0.0-inplace-test-mkr-txn.
>
> Regards
> Sumit
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201117/82bf141b/attachment.html>


More information about the Haskell-Cafe mailing list