www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Any version of any D compiler that works properly on Mac OS X 10.6?

reply zonk <nospam thx.com> writes:
Is anybody developing in D on Snow Leopard?

 &#8226; DMD2 produces executables that crash on startup. 
 &#8226; DMD1 sort-of works, but seems to ignore many commandline switches
(e.g. I can't get assert() nor unittest{} to work).
 &#8226; GDC is only for 10.4 and 10.5.
 &#8226; LDC doesn't even officially support OS X. I've tried compiling it, but
it didn't work properly (seems to fail because of 32/64 bit confusion).

Is there any other implementation that would work? Old stable version? Would
DMD work under (Dar)wine?
Nov 02 2009
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
zonk wrote:
 Is anybody developing in D on Snow Leopard?

  &#8226; GDC is only for 10.4 and 10.5.

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 But there is no GDC installer for Snow Leopard, and I don't think that gcc-4.2 works yet either ? GCC now also defaults to 64-bit mode, so you need to use "gcc -m32" to compile in 32-bit mode for D. --anders
Nov 02 2009
next sibling parent zonk <nospam thx.com> writes:
Anders F Björklund 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. 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).
 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).
Nov 02 2009
prev sibling next sibling parent reply zonk <nospam thx.com> writes:
Anders F Björklund 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. 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).
 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).
Nov 02 2009
parent =?windows-1252?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
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
Nov 03 2009
prev sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
 Is anybody developing in D on Snow Leopard?

  &#8226; GDC is only for 10.4 and 10.5.

GDC "should" be able to build for Mac OS X 10.6, if using the legacy gcc-4.0 compiler (gcc-5484)

One thing that *could* be done, is to install the older Xcode in /Developer - besides the newer one. You can install Xcode 2.5, and then install the GDC package for Tiger in /Developer/Xcode2.5/usr (you would want to use the darwin8 -isysroot of "/Developer/SDKs/MacOSX10.4u.sdk" for that one) http://downloads.sourceforge.net/gdcmac/gdc-trunk-r229-mac-10.4.dmg Or you can install Xcode 3.1, and then install the GDC package for Leopard in /Developer/Xcode3.1/usr (you would want to use the darwin9 -isysroot of "/Developer/SDKs/MacOSX10.5.sdk" for that one) http://downloads.sourceforge.net/gdcmac/gdc-trunk-r229-mac-10.5.dmg This should work in "compatibility" mode, until a "native" version of GDC has been made for gcc-4.2. --anders PS. There is a button in the Installer, where you can relocate the package from the default of /usr. If you want to use Tango instead of Phobos, you then install the Tango package (after the GDC)... http://downloads.dsource.org/projects/tango/0.99.8/tango-0.99.8-mac-10.4.dmg
Nov 03 2009