How to tell when app will run in 64-bit mode?

Ben Allison benski at winamp.com
Wed Feb 6 09:12:24 PST 2008


You can use the cpusubtype member of the fat_arch struct in the Mach-O 
header to determine the CPU type for a particular section.    man arch 
enumerates the CPU types; in particular, you would look for 
CPU_SUBTYPE_POWERPC64_ALL and CPU_SUBTYPE_X86_64_ALL.


Jon Gotow wrote:
> Is there a way to determine when an 'obese-binary' application will 
> launch in 64-bit mode?  I'm aware of Apple's CheckExecutableArchitecture 
> sample code
> 
>     http://developer.apple.com/samplecode/CheckExecutableArchitecture/
> 
> but that only distinguishes between Intel and PPC.  My attempts to 
> extend the code to check the cputype flag for x86_64 have been 
> unsuccessful, so I'm wondering if someone's aware of a better way (please?)
> 
>  - Jon
> 



More information about the MacOSX-dev mailing list