[mercury-users] [OT] Building gcc-4.1 for Mac?

Julien Fischer juliensf at csse.unimelb.edu.au
Sat Oct 7 00:09:58 AEST 2006


On Fri, 6 Oct 2006 doug.auclair at logicaltypes.com wrote:

> Dear Julien,
>
> Here is the error I get when I attempt to compile on the intel mac:

Ah ... if it's an Intel Mac then you're going to run into problems
anyway (no matter what's happening with the garbage collector).
Currently the Mercury Mac OS X port works only on PowerPC based
machines.

Porting Mercury to Intel based Macs shouldn't be too difficult; the
main culprit is the configure script which assumes that Apple Darwin
also means PowerPC.  This is not true any more so it needs to be
generalised to handle the i686-apple-darwin* architecture.

There are a couple of other issues that might come up:

(1) the asm_fast grades probably won't work on that Darwin/x86.
     (for the same reason they don't work on Darwin/PPC - see
      README.MacOS)

(2) there may also be some problems with the reg grades and shared libs.

The attached patch (against the main branch) is my best guess at the
changes that need to be made in order to support Intel based Macs - I don't
have access to one to test so an (educated) guess is the best I can do
at the moment.

...

> gc_grade=`scripts/ml --grade reg.gc --print-gc-grade`; \
> cd boehm_gc && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts ../scripts/mmake  GC_GRADE=$gc_grade
> MAKEFLAGS=""; export MAKEFLAGS; \
> make  -j1 GRADE=reg.gc GC_GRADE=gc \
>        libgc.a libgc.a \
>        FINAL_INSTALL_MERC_GC_LIB_DIR=/Users/ptolemy/languages/mercury/mercury-0.13.0/lib/mercury/lib \
>        a
> ../scripts/mgnuc --grade reg.gc --no-ansi --no-check --no-mercury-stdlib-dir -I./include -DSILENT -DNO_DEBUGGING -DNO_EXECUTE_PERMISSION -DLARGE_CONFIG      -c -o alloc.o alloc.c
> <command line>:1:1: warning: "__GNUC__" redefined
> <built-in>:1:1: warning: this is the location of the previous definition
> <command line>:1:1: warning: "__GNUC_MINOR__" redefined
> <built-in>:1:1: warning: this is the location of the previous definition
> <command line>:1:1: warning: "__GNUC_PATCHLEVEL__" redefined
> <built-in>:1:1: warning: this is the location of the previous definition
> <command line>:1:1: warning: "__APPLE_CC__" redefined
> <built-in>:1:1: warning: this is the location of the previous definition
> In file included from ./include/private/gc_priv.h:70,
>                 from alloc.c:19:
> ./include/private/gcconfig.h:304: error: parse error before '--' token
> make[3]: *** [alloc.o] Error 1
> make[2]: *** [submake] Error 2
> make[1]: *** [boehm_gc] Error 2
> make: *** [all] Error 2
>
> -----
>
> Any pointers here would be helpful.  gcconfig says:
>
> "Not really supported, but at least we recognize it"
>
> Is there a new boehm GC that works with intel macs?

I _think_ that versions after 7.0alpha do - in any case the Mercury
ROTDs contain a very recent version of the Boehm GC so you may want to
try them rather than version 0.13.  (Note that this version of the gc
is broken on Darwin/PowerPC).

Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list