[mercury-users] asm_fast(.gc) for intel/mac?
Ben Schmidt
b.schmidt at ugrad.unimelb.edu.au
Mon Feb 5 16:11:29 AEDT 2007
> Yes, but if you are using the apple supplied builds of gcc it may
> require a bit of effort convincing them to compile the C code
> generated by the compiler. With apple's build of gcc 4.0 I could
> only get the source
> distribution to build by compiling the C code at -O0, e.g. by putting
>
> EXTRA_CFLAGS=-O0
>
> in the Mmake.params file at the top-level of the source tree.
>> I seem to recall
>> it compiling just fine for SPARC/Solaris. If it is broken for intel/mac,
>> what would it take to get it working?
>
> The same thing that it would take to get it working for ppc/mac - someone
> fixing the problems in gcc's darwin support. (I think one of the problems
> is the gcc bug mentioned in README.MacOS; there may be others, when we
> last tried on ppc/mac we couldn't get past that one though). Ben
> Schmidt has been using Mercury on an Intel Mac and he mentioned a few
> weeks ago that gcc 4.2 may fix some of the problems. (There was some
> discussion
> of it on one of the Mercury mailing lists but I don't remember which.)
I successfully compile Mercury out of the box using a patched version of
Apple's GCC. It uses grade reg.gc by default, I think, but it does work
with optimisations turned on. It doesn't work with asm_fast.gc, though I
haven't investigated why; the assembler gives parse errors, IIRC, which
probably means the compiler is generating wrong code, but I am not sure.
There are two particular GCC bugs that cause problems and one is fixed
in the GCC mainline, and one is fixed in Apple's GCC, but neither branch
contains both fixes. Hopefully at least the next release of the Apple
XCode Tools will have both bugs fixed, even if Apple doesn't contribute
their fix back to the mainline by the next major mainline release.
My patch is attached; it is against Apple's GCC 4.0.1 build 5363
sources. It contains a tiny shell script build_it which I use to start
the build as described in Apple's readme, and also disables parallel
compilation, as it wasn't working for me.
Ben.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc-5363-patch
URL: <http://lists.mercurylang.org/archives/users/attachments/20070205/33a53327/attachment.ksh>
More information about the users
mailing list