Re: Universal binary with x86_64 for 10.6 only
Re: Universal binary with x86_64 for 10.6 only
- Subject: Re: Universal binary with x86_64 for 10.6 only
- From: Steve Christensen <email@hidden>
- Date: Wed, 20 Jan 2010 16:41:18 -0800
I seem to recall that the Leopard kernel is 64-bit so your x86_64 binary is fair game for a command line tool. And since you built against the 10.6 SDK, it looks like it's using 10.6-only loader commands. I expect that if you built against the 10.5 SDK, everything should work fine. Is there some reason why a 64-bit version shouldn't run under Leopard?
On Jan 20, 2010, at 2:41 PM, BJ Homer wrote: I'm building a command-line tool, and I want it to run 32-bit on Tiger and Leopard and 64-bit on Snow Leopard. I have set the Base SDK to be 10.4, with a conditional build setting on x86_64 for 10.6. I have done the same for the deployment target; 10.4 generally, 10.6 for x86_64.
When I run the binary on Snow Leopard, it works fine. When I run it on Leopard, I get the following error:
Dyld Error Message: unknown required load command 0x80000022 I've used otool to inspect the binary. It appears that the unknown required load command is LC_DYLD_INFO_ONLY. On the Leopard machine, `otool -lv -arch x86_64 <binary>` shows the unknown command. Running the same command on Snow Leopard shows LC_DYLD_INFO_ONLY in the same place. So I've verified that I can identify it. When I run it with -arch i386, the command isn't there. This is what I expected; the x86_64 build is targeted for 10.6 only, so it's fine if SL-only load commands are present there.
The problem: Running the binary from the command line on Leopard crashes. In the crash report it's apparent that it's attempting to run the x86_64 version, even though that one has a deployment target of 10.6.
I've found the LSMinimumSystemVersionByArchitecture key that can be put into an app bundle's Info.plist, but this is a flat file. I tried embedding the Info.plist inside the flat binary, but it didn't seem to make a difference.
Am I doing something wrong? I had thought that when running a universal binary, it would look through all the binaries and find the best choice that it can run. Since x86_64 is linked against the 10.6 SDK, I had thought it would pass over that and use the 10.5 SDK. Is this incorrect?
Any ideas?
-BJ Homer
|
Attachment:
PGP.sig
Description: PGP signature
_______________________________________________
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