another awful hack to GHC 6.11

Posted by Mark Wed, 16 Sep 2009 23:42:00 GMT

For those of you who've been following along, in our last episode, we'd _almost_ managed to build GHC HEAD on Mac. Since that time, the rts_builtin bug has been fixed, and GHC will now install cleanly. There are still a few nasty shims to add in before Hubris will do what you want, however. (I'm going to assume you're up to date with the awful hacks from the last post: let me know if they need expansion)

UPDATE: this looks to not be entirely necessary - I can leave the rpath parameter out and the code still links now. I'm leaving this in as a reminder if I hit the problem again. First, the -rpath argument to ld on Mac needs some special Leopard loving: anything less than 10.5 is insufficient. ticket is here

second, ghc HEAD installs its libraries in /usr/local/lib/ghc-$VERSION/, then expects to see them in /usr/local/lib. There might be a cleaner way of fixing it, but for the moment,

ln -sf /usr/local/lib/ghc-6.11.20090915/*.dylib /usr/local/lib
will do the trick. (Yes, I _do_ love that green on black text, thanks for asking.)

And, just to show I'm not completely full of it, in classic "Works On My Machine(tm)" style:

11:53 ~/projects/HubrisBuild % uname -srv
Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386
11:53 ~/projects/HubrisBuild % irb 
irb(main):001:0> require 'lib/hubris'
mkdir: /Users/mwotton/.hubris_cache: File exists
creating Makefile
=> true
irb(main):002:0> class Foo
irb(main):003:1> include Hubris
irb(main):004:1> end
=> Foo
irb(main):005:0> f=Foo.new
=> #
irb(main):006:0> f.inline("foo (T_FIXNUM n) = T_FIXNUM (sum [1..n])", { :no_strict => true })
=> true
irb(main):007:0> f.foo(10)
=> 55
irb(main):008:0> 

Patches to the github repo will be up as soon as i've cleaned them up.

Leave a comment

Comments