GHC 6.8.1 (now ghc-6.8.2) on Mac OS X 10.5 (Leopard)

Christian Maeder Christian.Maeder at
Fri Jan 11 06:09:31 EST 2008

"man ld" on Tiger says:

-macosx_version_min version
    This overrides the MACOSX_DEPLOYMENT_TARGET environment variable
    (see below).  Unlike other linker options, this one may be spec-
    ified multiple times; only the last occurrence is effective.

The following environment variable is used to control the use of incom-
patible features in the output with respect to Mac OS X releases.

    This is set to indicate the oldest Mac OS X  version  that  that
    the output is to be used on.  When this is set to a release that
    is older than the current release features that are incompatible
    with that release will be disabled.  If a feature is seen in the
    input that can't be in the output due to this setting a  warning
    is issued.  The current allowable values for this are 10.1, 10.2
    10.3, and 10.4 with the default being 10.4 for the  i386  archi-
    tecture and 10.1 for all other architectures.

"man ld" on Leopard does not mention MACOSX_DEPLOYMENT_TARGET, but
"-macosx_version_min" does not work as expected:

When passing "-macosx_version_min 10.4" via ghc to gcc and ld using:

ghc -v --make Hello.hs \
  -optl-Xlinker -optl-macosx_version_min -optl-Xlinker -optl10.4

then "-macosx_version_min 10.4" lands almost at the end of "collect2"
and has no effect, because the command starts with "-macosx_version_min
10.5.1" (although the above man page claims that the last occurrence
should be effective).

Cheers Christian

/usr/libexec/gcc/i686-apple-darwin9/4.0.1/collect2 -dynamic -arch i386
-macosx_version_min 10.5.1 -weak_reference_mismatches non-weak
Hello.o -macosx_version_min 10.4 -lHSbase- -lHSrts -lm -framework
GMP -lgcc_s.10.5 -lgcc -lSystem -F/home/maeder/Library/Frameworks

Christian Maeder wrote:
> setting
> or
> on an Intel Leopard produced binaries executable on Intel Tigers (we
> have no Intel Panther, though)
> Without MACOSX_DEPLOYMENT_TARGET binaries from Leopard yield "Bus Error"
> on Tiger.
> The binary was built using my own binary-dist for Intel Tiger (Mac OS
> 10.4) (with GMP and GNUreadline frameworks).
> Christian

More information about the Glasgow-haskell-users mailing list