Re: Running 64-bit binary
Re: Running 64-bit binary
- Subject: Re: Running 64-bit binary
- From: "Clark Cox" <email@hidden>
- Date: Fri, 29 Jun 2007 07:29:36 -0700
On 6/29/07, Calum Robertson <email@hidden> wrote:
Hi,
My organisation traditionallly builds 32 bit software but due to user
requests we need to build 64 bit versions as well. I've managed to create
a universal binary that contains the code for both 32 bit and 64 bit
architectures targetting the Intel processor i.e. my XCode architecture
settings for configuration and target are both set to i386 and x86_64.
When I execute the unix 'file' command on the resulting executable, I can
see that it contains the code for both architectures.
Given all that waffle, my question is: how can I specify which
architecture code gets executed when I run the binary?
As Chris said, there will be a simpler mechanism for doing this under
Leopard. What I've done in the past, on Tiger, to test a specific
arch, regardless of what the hardware prefers is to simply use lipo to
strip out the other archs:
lipo <my executable> -thin i386 -ouput <my thinned executable>
Is it the 32 or 64 bit version that gets executed.
The rules are simple; basically, the "most native" is preferred:
1) on ppc, only ppc can be executed
2) on ppc64, the first of (ppc64, ppc) is executed
3) on i386, the first of (i386, ppc) is executed (i.e. Rosetta cannot
execute ppc64)
4) on x86_64, the first of (x86_64, i386, ppc) is executed
I suppose in order to performance test 64 bit, I could just specify 64 bit
architecture when building the application, however, I'm interested in the
answer to the above question.
You don't need to do anything special to test the 64-bit version; if
your hardware is capable, you're already running the 64-bit version.
--
Clark S. Cox III
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden