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

2

7

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!

Laufer answered 14/11, 2009 at 6:42 Comment(0)
U
2

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

Haskell Platform

Unchancy answered 18/4, 2011 at 18:1 Comment(0)
C
1

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.

Citronellal answered 14/11, 2009 at 20:55 Comment(2)
Lame! I guess I'll have to develop on my 32-bit machine. Thanks for the response, I'll mark it as answered if I don't hear anything more promising by tomorrow ^_^Laufer
@paul.meier: You can still work on a 64-bit machine. You just need to have GHC generate 32-bit binaries. I have GHC on my Core 2 Duo MacBook Pro with Snow Leopard and it compiles just fine with the appropriate flags set.Maryn

© 2022 - 2024 — McMap. All rights reserved.