Any version of any D compiler that works properly on Mac OS X

Anders F Björklund afb at algonet.se
Tue Nov 3 00:19:02 PST 2009


zonk wrote:

>> GDC "should" be able to build for Mac OS X 10.6,
>> if using the legacy gcc-4.0 compiler (gcc-5484)
>>
>> http://opensource.apple.com/tarballs/gcc/gcc-5484.tar.gz (Xcode 3.1)
>> http://downloads.sourceforge.net/gdcmac/gdc-trunk-r229-apple-gcc-5484.patch
> 
> I'm not sure if I applied this patch correctly, it complained about missing files.

Well, you would need to apply the patch against the GDC svn trunk:
http://sourceforge.net/projects/dgcc/develop

It was working against the 229 revision of GDC matching DMD 1.030:
http://downloads.sourceforge.net/gdcmac/gdc-trunk-r229.tar.bz2

After that you follow usual instructions and run the setup script:
./gcc/d/setup-gcc.sh

Having extracted the GCC tarball and added the patched GDC to it,
it should now be ready to build - all patches should be applied...

> I also don't know right configure flags to build GCC. With just ../gcc-5484/configure && make it doesn't compile:
>  
> Undefined symbols:
>   "_build_modify_expr", referenced from:
>       _ix86_darwin_handle_regparmandstackparm in libbackend.a(i386.o)
>   "_store_init_value", referenced from:
>       _convert_to_vector in libbackend.a(convert.o)
>   "_objc_create_init_utf16_var", referenced from:
>       _darwin_build_constant_cfstring in libbackend.a(darwin.o)
> 
> (lots of errors follow).

Normally the Apple GCC is not built with configure, see README.Apple.
http://gdcmac.sourceforge.net/gcc-5363-README.Apple (or in the tarball)

Otherwise you would want to use the regular "FSF" GCC, for configure.
However, Snow Leopard is not a supported primary platform for that...

>> But there is no GDC installer for Snow Leopard,
>> and I don't think that gcc-4.2 works yet either ?
> 
> It is the default compiler in XCode (i686-apple-darwin10-gcc-4.2.1).

Right, what I meant was that I don't think GDC works with that GCC yet.
But it should be possible to run gcc-4.0 and the 10.5 sdk on 10.6 too ?

There is also the llvm-gcc, which (could) work somewhat similar to ldc.
It is based on the same version as Apple GCC (4.2.1), i.e. before GPL3.


Basically Snow Leopard is not a supported platform for D yet...
(and I currently don't have any plans to upgrade to it myself)

But gcc-4.0 should work, and gcc-4.2 is doable. LLVM preferred!
For GDC, the best would probably to have it work with gcc-5646 ?

But either of these (Apple GCC 4.2 or LLVM GCC 4.2) would need work,
maybe anyone interested could join http://bitbucket.org/goshawk/gdc

http://opensource.apple.com/tarballs/gcc/gcc-5646.tar.gz
http://www.llvm.org/releases/2.6/llvm-gcc-4.2-2.6.source.tar.gz (5649)

--anders



More information about the Digitalmars-d mailing list