Re: Build Universal 32/64 bit with XCode 3.2.6->no 64 bit
Re: Build Universal 32/64 bit with XCode 3.2.6->no 64 bit
- Subject: Re: Build Universal 32/64 bit with XCode 3.2.6->no 64 bit
- From: Christiaan Hofman <email@hidden>
- Date: Fri, 23 Sep 2011 17:03:30 +0200
On Sep 23, 2011, at 14:54, Loren Ryter wrote:
> I'm sorry to be sooo dense, but I still don't understand what's going on.
> If someone could look at what I'm describing (and picturing) here and walk
> me through the solution, I would sure appreciate it. This used to be
> simple -- build as 32/64 bit universal binary.
>
> I introduced the conditional build settings for the purpose of including
> 10.5+ libraries. There are checks in the code so those libraries are not
> used with 10.4 at runtime. The deployment target is 10.4.
>
> So I _thought_ there were TWO sets of "valid architectures". One says
> just "Valid Architectures". Then directly below it, indented, says
> specifically "Mac OS X 10.5". So what is the distinction between THOSE
> two entries (as opposed to that between 'architectures' and 'valid
> architectures'), if not that the latter applies to 10.5+ and the former
> applies to 10.4?
>
> (To be clear, here's a screen shot of what I have that builds without
> error but does not produce a 64 bit binary):
>
> http://img841.imageshack.us/img841/3776/buildsettings2.jpg
>
The Mac OS X 10.5 setting is used when you use the 10.5 *SDK* (Base SDK), it's NOT, and I repeat again NOT about the runtime OS. As you've set the SDK to current, this means 10.6 in your case, and therefore it will *not* use the 10.5 specific setting for valid archs but the generic one (without x86_64).
As I said, this is all explained in the docs about xcode, before coming to this list you should have read this.I advice you to do this now.
> At any rate, what I get if I add "X86_64" to the first entry, ie, "Valid
> Architectures" are build errors (and a failure):
>
> warning: Mac OS X version 10.5 or later is needed for use of the new objc
> abi
> error: Mac OS X version 10.5 or later is needed for zerocost-exceptions
>
> But I know that; the purpose of those conditional build settings were such
> that the code in question would require 10.5 (and be checked at runtime).
>
But this is a *compile time* problem, not a *runtime* problem. Checking at runtime therefore is not relevant.
> So again, if I remove "X86_64" from the first entry ("Valid
> Architectures"), it builds fine -- and runs on PPC and intel on 10.4 and
> higher. BUT the result is that it does NOT run in 64 bit mode on
> Lion/Intel.
>
>
>
> What I want to do is correct that latter problem. I'm not concerned with
> limiting the 64 bit binary from being used at runtime on 10.4 (at this
> point, but may have to be later, I see). I'm concerned about a 64 bit
> binary actually being produced for 10.5+.
>
> Thanks again for your patience.
>
What you want is to have i386 and ppc for 10.4 and later, and x86_64 for 10.5 and later. This means that the archs you build should be related to the *minimum* OS version (deployment target), not the *maximum* (base SDK). The way to do this is to make the *deployment target* conditional on the arch, *not* the (valid) archs conditional on the SDK. So add a build setting conditional to the deployment target setting for "Intel 64-bit", and set it to 10.5.
Christiaan
>>
>> On Sep 22, 2011, at 21:24, Mills, Steve wrote:
>>
>>> On Sep 22, 2011, at 14:01:05, Loren Ryter wrote:
>>>
>>>> Architectures: x86_64 i386 ppc
>>>> Valid Architectures: i386 ppc ppc7400 ppc970
>>>> Mac OS X 10.5: X86_64 i386 ppc64
>>>>
>>>> Note that I removed x86_64 from the first part of "Valid Architectures"
>>>> while adding it to "Architectures".
>>>>
>>>> Now it builds without error. It runs on all necessary platforms from
>>>> PPC/Tiger thru Intel/Lion.
>>>>
>>>> HOWEVER, it still doesn't run in 64 bit mode on Lion.
>>>>
>>>> Since the deployment target is 10.4, I assumed that the first line of
>>>> "Valid Architectures" applies to 10.4, while the second line, that says
>>>> 10.5, would apply to 10.5 and up. Is this correct?
>>>
>>> No, valid architectures means "which ones would it ever be correct to
>>> build". Architectures just means "build these for this project/target".
>>> Architectures should be <= valid architectures. If an arch isn't in
>>> valid, then adding it to architectures won't make it build. Add x68_64
>>> to both.
>>>
>>> --
>>> Steve Mills
>>> office: 952-818-3871
>>> home: 952-401-6255
>>> cell: 612-803-6157
>>
>>
>> So to summarize, what is build is the intersection of archs and valid
>> archs (unless you've checked the only active arch setting).
>>
>> And as for your second part, this does not make sense, not in practice
>> and even not logically. Conditional build settings (conditional on OS)
>> depend on the *SDK* that you're using. *Not* on the OS version on which
>> it will run, that's impossible, as that is fundamentally unknowable at
>> compile time (the OS version on which it runs is a run-time condition,
>> that's a tautology).
>>
>> If you want to prevent the 64-bit arch binary from being used on 10.4
>> (but still want to have it for later OS versions), you have to tell the
>> *runtime* not to use it, not the compiler. You do that in Info.plist
>> using the LSMinimumSystemVersionByArchitecture key.
>>
>> Christiaan
_______________________________________________
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