<div dir="ltr">Hi guys,<div><br></div><div>Just wanted to report on the steps/hacks to a successful build of GHC HEAD on OS X 10.9 thanks to help from Carter Schonwald and Austin Seipp.</div><div><br></div><div>1) I installed LLVM 3.4</div>

<div>brew install llvm --with-clang --HEAD<br></div><div><br></div><div>2) I used this <a href="http://build.mk">build.mk</a>:</div><div><div>HADDOCK_DOCS &nbsp; &nbsp; &nbsp; = NO</div><div>BUILD_DOCBOOK_HTML = NO</div><div>BUILD_DOCBOOK_PS &nbsp; = NO</div>

<div>BUILD_DOCBOOK_PDF &nbsp;= NO</div><div>SPLIT_OBJS &nbsp; &nbsp; &nbsp; &nbsp; = NO</div><div>INTEGER_LIBRARY &nbsp; &nbsp;= integer-simple</div></div><div><br></div><div>3) Austin let me know I needed to pass &quot;-x assembler-with-cpp&quot; to clang when in preprocessor mode, so I wrote a wrapper clang.hs, compiled it, put it in my path, and changed /usr/local/lib/ghc-7.6.2/settings to use it. (it also passes some flags Carter suggested, along with extra include flags, which were necessary as of a couple weeks ago but might have been fixed in the newer DPs)</div>

<div><a href="https://gist.github.com/lukexi/e11668ced04524564a8b">https://gist.github.com/lukexi/e11668ced04524564a8b</a><br></div><div><br></div><div>4) I used&nbsp;</div><div>./configure --with-gcc=clang&nbsp;</div><div>(where clang is the wrapper script above)</div>

<div><br></div><div>5)&nbsp;&quot;inplace/bin/mkdirhier&quot; bootstrapping/. failed mysteriously, so I manually created bootstrapping/ in the ghc build dir.</div><div><br></div><div>6) DTrace failed with an &quot;unsupported compiler&quot; error during compilation, so I killed that section in <a href="http://configure.ac">configure.ac</a></div>

<div><div># if test -n &quot;$DtraceCmd&quot;; then</div><div># &nbsp; if test &quot;x$TargetOS_CPP-$TargetVendor_CPP&quot; = &quot;xdarwin-apple&quot; -o &quot;x$TargetOS_CPP-$TargetVendor_CPP&quot; = &quot;xsolaris2-unknown&quot;; then</div>

<div># &nbsp; &nbsp; HaveDtrace=YES</div><div># &nbsp; fi</div><div># fi</div></div><div><br></div><div>7) I got the error:</div><div><div>libraries/integer-simple/GHC/Integer/Type.hs:836:50:</div><div>&nbsp; &nbsp; Not in scope: &#8219;.&rsquo;</div><div><br>

</div><div>libraries/integer-simple/GHC/Integer/Type.hs:847:67:</div><div>&nbsp; &nbsp; Not in scope: &#8219;.&rsquo;</div></div><div><br></div><div>I hacked through this by manually find-and-replacing&nbsp;WORD_SIZE_IN_BITS with 64 in Type.hs.</div>

<div><br></div><div>make &amp;&amp; make install then ran to completion and some simple test programs seem to compile and run fine.</div><div><br></div><div>Cheers</div><div>Luke</div></div>