Installation error Cabal / usr / bin / ld: --hash-size = 31: unknown parameter

When trying to install any package on my computer using a command like

cabal install http-conduit 

Installation aborts with the following error:

 /usr/bin/ld: --hash-size=31: unknown option 

How can i solve this?

Note. This question intentionally does not show research efforts, because it was immediately answered in the Q & A-Style style.

+6
source share
1 answer

This issue occurs with binutils-gold and GHC 7.4. There is an old mailing list entry discussing this issue.

For example, you might need binutils-gold for LLVM, but GHC 7.4 cannot handle the GOLD linker correctly because it does not understand the --hash-size parameter.

As noted in the mail list, the solution to this is to remove binutils-gold, for example. on using Ubuntu:

 sudo apt-get remove binutils-gold 

This will cause /usr/bin/ld to re-symbolize to a non-GOLD linker version. After that, repeat the cabal install command.

+4
source

All Articles