64 bit DMD binary on the Mac

Jacob Carlborg doob at me.com
Tue Jun 28 12:13:35 PDT 2011


On 2011-06-28 20:53, Robert Clipsham wrote:
> On 28/06/2011 19:43, Walter Bright wrote:
>> Although DMD on the Mac can currently only generate 32 bit binaries, the
>> Mac as I understand it can run 64 bit code.
>>
>> Is there any reason that DMD itself should be a 32 bit app? Are there
>> any 32 bit only Macs out there we should support?
>
> Standard practice is to use universal binaries, that is, having both the
> 64 bit and 32 bit binary in one eg:
>
> $ file `which which`
> /usr/bin/which: Mach-O universal binary with 3 architectures
> /usr/bin/which (for architecture x86_64): Mach-O 64-bit executable x86_64
> /usr/bin/which (for architecture i386): Mach-O executable i386
> /usr/bin/which (for architecture ppc7400): Mach-O executable ppc
>
> Although this will increase binary size, obviously. OS X then chooses
> which version to use itself, with preference being the same order as
> above (64, 32, ppc).
>
> This said, I see no reason why you can't switch to a 64 bit binary, as
> far as I'm aware all the intel hardware apple has shipped supports
> running 64 bit applications. You may want to check this though.

Very few applications are 64bit on Mac OS X 10.5. Most of the 
applications are 64bit on Mac OS X 10.6. Although, as far as I 
understand it, quite few Macs actually run the kernel in 64bit (by 
default), if that matters.

Since most of the applications and most the libraries (basically all 
that ships with Mac OS X) are universal there's usually no problem of 
running/building both 32 and 64bit software.

I just had a look at this:

http://support.apple.com/kb/ht3696

Any Mac running Intel Core Solo or Intel Core Duo is 32bit only. 
Although it's hard to tell how many users that have a Mac with any of 
the above CPU's.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list