GHC 6.8.1 on Mac OS X 10.5 (Leopard)

Deborah Goldsmith dgoldsmith at mac.com
Thu Nov 15 11:27:37 EST 2007


On Nov 6, 2007, at 4:06 PM, Manuel M T Chakravarty wrote:
> I wasn't expecting any backwards compatibility from Leopard-built  
> software to Tiger, but then I am also a Mac-noob and maybe there are  
> ways to achieve that that I don't know of.  Any suggestions?

Sorry, I missed this the first time around...

To build binaries on Leopard that are compatible with previous  
releases of Mac OS X, you need to use the appropriate SDK parameters  
when invoking gcc (for includes) and the linker (for libraries). This  
is described in the context of building a universal binary in:

http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html#/ 
/apple_ref/doc/uid/TP40002850-BAJCFEBA

but the same concepts (-isysroot for gcc and -Wl,-syslibroot for ld)  
apply to building against any SDK.

An SDK is basically a copy of the frameworks and libraries for a  
particular OS release, but the libraries are just stubs to link  
against. By pointing gcc and ld at an SDK, you use the correct headers  
and entry points for a particular release.

Caveat: I don't know how use of SDKs interacts with use of non-system  
libraries (e.g., in /opt/local or /Library/Frameworks).

Another approach is to set MAC_OS_X_VERSION_MIN_REQUIRED to  
MAC_OS_X_VERSION_10_4 (or whatever). You then have to be careful about  
how you use APIs that are new in Leopard. I would think the SDK  
approach would be easier for something like ghc.

If you don't do anything, by default binaries built on a particular  
Mac OS X release will only run on that release or later.

Deborah



More information about the Glasgow-haskell-users mailing list