GHC and Xcode 3 vs. 4
Manuel M T Chakravarty
chak at cse.unsw.edu.au
Wed Sep 14 02:50:37 CEST 2011
> I'm getting ready to build the Mac installers for the upcoming version of Haskell Platform. I've recently upgraded to a spiffy new MacBook Air and am running Lion on this machine, though still have machines with bootable 10.5 and 10.6 partitions....
> I'm wondering what is the state of building with Xcode 4 installed? Is that a happy thing? Seems that GHC 7.0.4 (what the next HP will be using) was compiled with Xcode 3.2. Do we know if builds are Xcode agnostic... that is, if GHC was built with one version of Xcode, will it install and work on some user's machine with the bintools from the other version of Xcode? Similarly, do we have a sense of the interoperability between bulit-on vs. installed-on for 10.5, 10.6, and 10.7?
> My hope is to do all future builds on 10.7 w/Xcode 4, and hope that will install and work for people with 10.6, 10.5, and those with Xcode 3.
Lion, Xcode 4 and GHC
I am using Xcode 4 on 10.7 for quite a while without problems BUT older versions of GHC (7.0.3) produce annoying linker warnings, but produce working binaries. We fixed these warnings in 7.3 (dev version) and in 7.2.1 (at least for x86_64). I am not sure about 7.0.4. I suspect that it still produces these warnings.
Moreover, older versions of GHC (again, I suspect 7.0.4 included) fail to bootstrap with Xcode 4. This is because Apple changed the default 'gcc' to point to 'llvm-gcc' (i.e., gcc with an llvm backend, which cannot compile GHC's RTS). Apple also distributed the conventional gcc with Xcode 4, but it needs to be invoked as 'gcc-4.2'. We changed the GHC build system to prefer gcc-4.2 (if available) in GHC 7.3 and 7.2.1, but I don't think in any other version.
In the past, I tried to build GHC distributions on the latest OS X in a manner that they also work on older versions of OS X and that provided to be very difficult. The reason was that the dynamic libraries (specifically, libA.dynlib) in new versions of the OS include labels that are not present in old versions. To prevent that problem, the standard approach on OS X is to compile against an older SDK. This works great for Xcode projects, but I never got it fully working for GHC. (I managed to produce a GHC that would compile Haskell programs on older versions of OS X, but not GHC itself.)
So, for now, you will have to build on the oldest version of OS X that you want to support.
BTW, for 10.7, I would suggest to only provide x86_64 builds and I am not convinced that it is necessary to continue to support 10.5.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cvs-ghc