Haskell ghc compiling/linking error, not creating executable. (linux)
Have you binutils-gold
installed? If yes, this is the problem (since the gold linker does not support --hash-size
AFAIK).
Possible solutions:
- remove gold
- your
ld
probably links told.gold
, so change the symlink told.ld
- tell the haskell compiler explicitly which linker to use with the
-pgml
option:ghc -pgml ld.ld tupel.hs
- install
ghc
from source, since the configure script ofghc
will then buildghc
so that it won't use--hash-size
- Depending on your version of
ghc
, you can adjust the linker settings inghc
's setting file/usr/lib/ghc-your.ghc.version/settings
Update - gold on Ubuntu 12.10 appears to move GNU ld to ld.bfd. To fix this problem I deleted the ld link as recommended and remade the link with
ln -s ld.bfd ld
ghc compilations are now going through.
(Couldn't see how to subvert the settings file in usr/lib/ghc, as the entry is for gcc which passes through its commandline to ld, although this would have been my preferred option, in case something else needs ld to be the way it was.)
Thanks to Dominic for the pointer of where to look! It was driving me crazy...