Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get 64-bit binaries from GHC for Snow Leopard?

I've recently upgraded my OS to Snow Leopard, which broke my GHC. I was able to fix it on one machine by adding flags for 32-bit compiles in /usr/bin/ghc (something like -optl -m32 -opta -m32 -optc -m32, gathered from here). Now I can't get it to produce 64-bit binaries for my other machine, which supports 64-bits. The 32-bit flags break, and removing them breaks as well. Any tips?

When I try to compile I get stuff like this:

/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:212:0:
32-bit absolute addressing is not supported for x86-64

/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:212:0:
cannot do signed 4 byte relocation

/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:215:0:
32-bit absolute addressing is not supported for x86-64

/var/folders/az/az3Ef9shFZq6RajmTEBwu++++TI/-Tmp-//ghc8006_0/ghc8006_0.s:215:0:
cannot do signed 4 byte relocation

Thanks!

like image 959
pablo.meier Avatar asked Nov 14 '09 06:11

pablo.meier


2 Answers

64 bit Snow Leopard installers for the Haskell Platform are available, as of 2011.

  • http://hackage.haskell.org/platform/mac.html

Haskell Platform

like image 188
Don Stewart Avatar answered Oct 14 '22 07:10

Don Stewart


My understanding is that at the moment ghc cannot generate correct 64 bit binaries under Snow Leopard. This appears to be in part because of a bug in its 64 bit link generation and in part because of a change in the native toolchain. The workaround you mention simply tells it to generate a 32 bit target and thus won't be part of any actual solution to your problem.

like image 44
Edward Kmett Avatar answered Oct 14 '22 06:10

Edward Kmett