Getting GHC/Cabal-Install working on Snow Leopard

Cribbed from http://www.haskell.org/haskellwiki/Mac_OS_X#Mac_OS_X_10.6_.28Snow_Leopard.29:

* Open /Library/Frameworks/GHC.framework/Versions/Current/usr/bin/ghc-6.10.4 in a text editor
* Insert -optc-m32 -opta-m32 -optl-m32 just before the last parameter.

The last line in that file is rather long, and should now end like -dynload wrapped -optc-m32 -opta-m32 -optl-m32 ${1+”$@”}

Don’t be tempted to just put an edited local copy of the script in ~/bin/ghc, or edit all the various GHC files in /usr/bin. There is a maze of twisty symlinks that all eventually lead to the above script, and fixing just it is far simpler. Many packages need hsc2hs. To make it work correctly you need similar hackery:

* Open /usr/bin/hsc2hs
* Insert –cflag=”-m32″ –lflag=”-m32″ before $tflag

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: