I wrote a basic hello world program in haskel and tried to compile it with:
ghc filename.hs. It produces .hi and .o files but no executable and displays
this error in the linker:
marox@IT-marox:~/Marox$ ghc tupel.hs
Linking tupel …
/usr/bin/ld: –hash-size=31: unknown option
/usr/bin/ld: use the –help option for usage information
collect2: ld returned 1 exit status
Googling didn’t return any useful information.
I am on ubuntu 12.04.
How can I fix this?
Have you
binutils-goldinstalled? If yes, this is the problem (since the gold linker does not support--hash-sizeAFAIK).Possible solutions:
ldprobably links told.gold, so change the symlink told.ld-pgmloption:ghc -pgml ld.ld tupel.hsghcfrom source, since the configure script ofghcwill then buildghcso that it won’t use--hash-sizeghc, you can adjust the linker settings inghc‘s setting file/usr/lib/ghc-your.ghc.version/settings