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: Scott Tooker <email@hidden>
- Date: Tue, 2 Jun 2009 14:46:58 -0700
YOu seem to be confused about how architecture relates to 32/64-bit.
The "bitness" is part of the architecture itself, so if you build for
i386, you are building for 32-bit Intel, x86_64 is 64-bit Intel.
Similarly, ppc is 32-bit PowerPC and ppc64 is 64-bit PowerPC. Yes, it
is true that on the PowerPC side there are older architecture codes
that map to specific chips (like ppc9700 or ppc750), but those
architectures codes are rarely used in Xcode these days.
You just need to build a 32/64 bit universal application (aka. 4-way
fat application) which contains all the architectures you want (ppc
and 1386 for 32-bit support, x86_64 and ppc64 for 64-bit support),
using the build settings Clark outlined.
Then you'll need to use the LSArchitecturePriority in your Info.plist
to get the 64-bit architecture slices preferred over the 32-bit
versions on Leopard and later.
No need for multiple apps.
Scott
On Jun 2, 2009, at 2:24 PM, Alex Sheh wrote:
Thank you for the detailed responses, Shawn. Thanks, Clark, I just
saw your email, and your explanation is also very clear.
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.
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.
I can't think of any way to use universal binaries to avoid shipping
2 different installers. A user could be running either 10.4 or 10.5
on any given ppc64 machine, and the ppc64 binary would have to be
either 32-bit or 64-bit, but not both. Just wanted to make sure I'm
not overlooking anything here regarding possible deployment solutions.
Specifically for us, we have a Cocoa-based preference pane, and a
couple other plugins and an app that are using a smattering of
classes from the Foundation framework. These are the ones that we
would like to compile as 64-bit to run on 10.5 or later. I suppose
for the latter non-Cocoa apps, if I refactored/removed the Objective-
C dependencies (usage of Foundation framework, etc.), then I could
just use runtime checks to make sure that any other 10.5 functions I
use are indeed available.
Does that make sense, am I understanding this correctly?
Thanks so much for the help.
Best,
Alex
-----Original Message-----
From: Shawn Erickson [mailto:email@hidden]
Sent: Tuesday, June 02, 2009 11:23 AM
To: Alex Sheh
Cc: Xcode List
Subject: Re: 64-bit, 10.5/10.4, SDK build settings
On Tue, Jun 2, 2009 at 11:13 AM, Alex Sheh <email@hidden> wrote:
Thanks for the replies, Shawn.
I was considering using the below settings. This way, on ppc and
x86, I wouldn't have to put additional runtime checks for function
availability (since the ppc and x86 binaries would be building
against 10.4 as well as deploying on 10.4).
SDKROOT = macosx10.4
SDKROOT[arch=ppc64] = macosx10.5
SDKROOT[arch=x86_64] = macosx10.5
MACOSX_DEPLOYMENT_TARGET = 10.4
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5
But with respect to the below settings, doesn't this mean that on
ppc64 and x86_64, the software would only run on 10.5 or later? We
need to support 10.4 or later on ppc64 and x86_64.
Mac OS X 10.4 (Tiger) only supports 64-bit binaries that link
against libSystem (aka POSIX, etc.) and handful of low-level
libraries/frameworks. You cannot build an Objective-C / Cocoa / etc.
using application for 64b using the 10.4 SDK.
However, I'm unable to use the below settings, because if I build
against the 10.5 SDK, Xcode warns me that there is a new Objective-
C ABI that requires me to deploy on 10.5 or later.
As it should since no 64b Objective-C runtime exists on 10.4.
I suggest you do the following and put in the needed runtime checks
in your code. This gives your customers the best experience by
allowing your software to leverage the features of the operating
system you are running on.
SDKROOT = macosx10.5
MACOSX_DEPLOYMENT_TARGET = 10.4
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5 MACOSX_DEPLOYMENT_TARGET
[arch=x86_64] = 10.5
-Shawn
_______________________________________________
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
References: | |
| >64-bit, 10.5/10.4, SDK build settings (From: Alex Sheh <email@hidden>) |
| >Re: 64-bit, 10.5/10.4, SDK build settings (From: Ken Thomases <email@hidden>) |
| >RE: 64-bit, 10.5/10.4, SDK build settings (From: Alex Sheh <email@hidden>) |
| >Re: 64-bit, 10.5/10.4, SDK build settings (From: Shawn Erickson <email@hidden>) |
| >Re: 64-bit, 10.5/10.4, SDK build settings (From: Shawn Erickson <email@hidden>) |
| >RE: 64-bit, 10.5/10.4, SDK build settings (From: Alex Sheh <email@hidden>) |
| >Re: 64-bit, 10.5/10.4, SDK build settings (From: Shawn Erickson <email@hidden>) |
| >RE: 64-bit, 10.5/10.4, SDK build settings (From: Alex Sheh <email@hidden>) |