Haskell ghc compiling/linking error, not creating executable. (linux)

后端 未结 2 652
萌比男神i
萌比男神i 2021-01-07 21:09

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 li

2条回答
  •  礼貌的吻别
    2021-01-07 21:35

    Have you binutils-gold installed? If yes, this is the problem (since the gold linker does not support --hash-size AFAIK).

    Possible solutions:

    1. remove gold
    2. your ld probably links to ld.gold, so change the symlink to ld.ld
    3. tell the haskell compiler explicitly which linker to use with the -pgml option: ghc -pgml ld.ld tupel.hs
    4. install ghc from source, since the configure script of ghc will then build ghc so that it won't use --hash-size
    5. Depending on your version of ghc, you can adjust the linker settings in ghc's setting file /usr/lib/ghc-your.ghc.version/settings

提交回复
热议问题