After many years, I have once again attempted to build GHC from source. The experience went much easier than in the past.<div><br></div><div>This time, my system is running the now-old 10.5 (Leopard) using Xcode 3.1.4. I&#39;m probably the only one who wants to build on 10.5, but I still appreciate the fact that GHC can be built on a variety of systems, allowing more people (like me) to hack on it.</div>

<div><br></div><div>I ran into a few minor issues when building.</div><div><br></div><div>(1) I had a problem with gmp. No surprise, and I didn&#39;t want to fight it, so I built with integer-simple by adding INTEGER_LIBRARY=integer-simple to ./mk/<a href="http://build.mk">build.mk</a> .</div>

<div><br></div><div>(2) It appears that integer-simple has a copy-paste bug that was easy to fix:</div><div><br></div><div><div>$ cd libraries/integer-simple/</div><div>$ git diff</div><div>diff --git a/GHC/Integer/Type.hs b/GHC/Integer/Type.hs</div>

<div>index 02eeef2..f620e67 100644</div><div>--- a/GHC/Integer/Type.hs</div><div>+++ b/GHC/Integer/Type.hs</div><div>@@ -97,8 +97,8 @@ integerToInt i = word2Int# (integerToWord i)</div><div> integerToWord64 :: Integer -&gt; Word64#</div>

<div> integerToWord64 i = int64ToWord64# (integerToInt64 i)</div><div> </div><div>-{-# NOINLINE word64ToInteger:: #-}</div><div>-word64ToInteger:: Word64# -&gt; Integer</div><div>+{-# NOINLINE word64ToInteger #-}</div><div>

+word64ToInteger :: Word64# -&gt; Integer</div><div> word64ToInteger w = if w `eqWord64#` wordToWord64# 0##</div><div>                     then Naught</div><div>                     else Positive (word64ToPositive w)</div>

</div><div><br></div><div>(3) A linker flag was added for Xcode 4 that is not available in 3.1.</div><div><br></div><div><div>$ git diff</div><div>diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs</div>

<div>index b655425..ec8024d 100644</div><div>--- a/compiler/main/DriverPipeline.hs</div><div>+++ b/compiler/main/DriverPipeline.hs</div><div>@@ -1682,10 +1682,12 @@ linkBinary dflags o_files dep_packages = do</div><div>                       -- like</div>

<div>                       --     ld: warning: could not create compact unwind for .LFB3: non-standard register 5 </div><div>                       -- on x86.</div><div>+{-</div><div>                       ++ (if platformOS   (targetPlatform dflags) == OSDarwin   &amp;&amp;</div>

<div>                              platformArch (targetPlatform dflags) `elem` [ArchX86, ArchX86_64]</div><div>                           then [&quot;-Wl,-no_compact_unwind&quot;]</div><div>                           else [])</div>

<div>+-}</div><div> </div><div>                       -- &#39;-Wl,-read_only_relocs,suppress&#39;</div><div>                       -- ld gives loads of warnings like:</div></div><div><br></div><div>I think the fix to integer-simple should be applied, since it&#39;s an obvious improvement.</div>

<div><br></div><div>I suspect the last issue might be controversial, since it seems to involve an apparently incompatible difference between the older and newer Xcode versions. Of course, I would like to see the older version still supported, but, as I said, I may be among a very small minority in this vote.</div>

<div><br></div><div>Regards,<br>Sean</div>