RE: 64-bit, 10.5/10.4, SDK build settings
RE: 64-bit, 10.5/10.4, SDK build settings
- Subject: RE: 64-bit, 10.5/10.4, SDK build settings
- From: Alex Sheh <email@hidden>
- Date: Tue, 2 Jun 2009 19:29:10 -0700
- Acceptlanguage: en-US
- Thread-topic: 64-bit, 10.5/10.4, SDK build settings
"Every CPU that can run ppc64 can also run ppc. Likewise, every CPU that can run x86_64 can also run i386."
Thank you, Greg. This is the source of my confusion. I thought each CPU would execute only one of the following binaries (based on the CPU type): ppc, ppc64, i386, or x86_64. But apparently this is not the case.
Regarding execution of an Objective-C/Cocoa app in different environments,
User owns a PowerPC G5 running 10.4 (Tiger).
- I assumed that the the fat binary's ppc64 binary would execute, since the PowerPC G5 hardware is 64-bit capable. But if the system knows to execute the ppc binary here, launching the 32-bit Cocoa plugin, then this is exactly what I want to happen.
User owns a PowerPC G5 running 10.5 (Leopard).
- The fat binary's ppc64 binary will execute, launching the 64-bit Cocoa plugin; this is what I want as well.
I didn't know a 64-bit capable MacOSX 10.4, running on a 64-bit capable CPU, would know to launch the 32-bit version of the Cocoa plugin. But I guess that MacOSX 10.4 has some higher level logic that knows to select the ppc version, and I guess it makes this determination because it knows that the ppc64 binary would require the 10.5 Objective-C runtime (which is not available)?
If my understanding is still incorrect, please let me know.
Thanks for all the replies thus far.
Best,
Alex
-----Original Message-----
From: xcode-users-bounces+asheh=email@hidden [mailto:xcode-users-bounces+asheh=email@hidden] On Behalf Of Greg Guerin
Sent: Tuesday, June 02, 2009 2:56 PM
To: list Xcode-users
Subject: Re: 64-bit, 10.5/10.4, SDK build settings
Alex Sheh wrote:
> So my understanding is, if I build a 64-bit Objective-C application,
> then it can only run on 10.5 or later (since there is no 64-bit
> Objective-C runtime on 10.4). And if I want an Objective- C
> application to run on 10.4, then it must be compiled as 32-bit.
Correct.
> This would mean that I need to ship 2 versions of the software, an
> installer containing the 32-bit version of the Objective-C application
> to run on 10.4 (Tiger), and another installer containing the 64-bit
> version of the Objective-C application to run on 10.5 (Leopard) or
> later.
Incorrect.
Universal binaries can be 4-way executable: ppc + ppc64 + i386 + x86_64.
The slice for one arch, say "ppc", need not be compiled for the same OS version as the slice for another arch, say "ppc64".
> ... the ppc64 binary would have to be either 32-bit or 64-bit, ...
That's nonsense. There is no such thing as a ppc64 binary that's 32- bit. It doesn't exist. It can't exist. If it's ppc64, it is always and only 64-bit.
What can and does exist is a 32-bit binary that runs on a CPU which can also run the ppc64 arch name, namely a G5. That arch name is "ppc" or "ppc7400", though, not "ppc64".
Every CPU that can run ppc64 can also run ppc. Likewise, every CPU that can run x86_64 can also run i386.
You're really confused about this. You should start with what the hardware is. What CPU does the user have? Once that's been identified, you can determine which arch names will execute on it.
Next you determine what OS version the user has. This will determine whether there is or isn't a 64-bit option at all. If there's no 64- bit option for the OS, then it doesn't matter what the hardware is, you can't run 64-bit on that OS version.
If that's still confusing, then draw the logic tree as an actual diagram on a piece of paper, starting with CPU hardware and adding conditionals for OS version.
-- GG
_______________________________________________
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
_______________________________________________
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