Re: Mac OS X Deployment Target
Re: Mac OS X Deployment Target
- Subject: Re: Mac OS X Deployment Target
- From: Ken Thomases <email@hidden>
- Date: Thu, 13 May 2010 22:11:10 -0500
On May 13, 2010, at 9:07 PM, Howard Rodstein wrote:
> The tips displayed at the bottom of the Xcode 3.2.2 build settings tab (on
> OS X 10.6.3) when you select Mac OS X Deployment Target say:
> "Mac OS X 10.5 - Code will not load on systems earlier than 10.5"
I would say "is not guaranteed to" instead of "will not".
> Empirically this does not seem to be always true. I compiled a plug-in with
> Mac OS X Deployment Target set to 10.5 but it still ran on OS X 10.4.11.
You got "lucky".
> However setting Mac OS X Deployment Target to "Compiler Default" or 10.6
> generated an executable that failed to dynamically link on OS X 10.4.11.
>
> Why would it run on 10.4.11 with Deployment Target set to 10.5 but not with
> it set to 10.6?
The tools are entitled to rely on features of the dynamic loader (dyld) that were introduced as of the deployment target. In particular, the 10.6 dynamic loader understands new kinds of load commands. If you build with a deployment target of 10.6, the tools are likely to use such commands. That results in a binary which the loader on older OSes does not understand.
That's just one effect that I know of. There are perhaps others.
> What exactly does "Mac OS X Deployment Target" do? It seems to have
> side-effects beyond controlling whether linking is strong or weak.
Why do you care? It's an implementation detail.
What it does is control whether the resulting binary is compatible with various versions of the OS. You should treat it as a black box beyond that.
> The projects that I am responsible for need to be compilable and runnable
> on OS X 10.4.11 or later. They do not use any new (post 10.4) stuff. I know
> I could set them to use Base SDK 10.4 and Mac OS X Deployment Target 10.4
> but I am hoping to avoid this because the 10.4 SDK is not installed by
> default on recent OS'es and also because using the 10.4 SDK requires using
> GCC 4.0 which may vanish in the next OS.
I am in a somewhat similar situation and I recommend setting both the SDK and deployment target to 10.4. I don't really see the issue with the concerns you expressed.
The SDK and the compiler are available and supported. They serve your current need. I think you should use them.
Your concern that they could go away is basically a concern that Apple may someday make it effectively impossible to target deployment to Tiger using some future version of the tools. Indeed they might. Because of that, you must plan to keep a build system that will be able to build your product for your required target(s) for as long as it's needed. That's simply a requirement of professional software development in an ever-changing world. (We still use a Tiger build system, although it's not strictly necessary.)
> Am I stuck with specifying 10.4 for both settings?
No. The deployment target setting must be kept at 10.4 since you deploy to 10.4. The SDK setting can be whatever you like, though. However, changing it away from 10.4 opens you up to accidentally using post-10.4 API without noticing it.
Regards,
Ken
_______________________________________________
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