Re: unknown required load command 0x80000022 once again
Re: unknown required load command 0x80000022 once again
- Subject: Re: unknown required load command 0x80000022 once again
- From: Ken Thomases <email@hidden>
- Date: Sat, 1 May 2010 00:45:37 -0500
On Apr 30, 2010, at 2:21 PM, mogambo wrote:
> I have a mount utility for a file system driver that I build separately for 10.6//64-bit and 10.4+/ppc+i386. It seems to me that there should be no reason to not being able to create a UB with a single build. However, I am running into the dyld error above when I build the utility on 10.6 and try to run it on 10.5.8 i386.
What does it mean to "try to run it on 10.5.8 i386"? Leopard is capable of loading and running 64-bit executables on hardware that's capable of it (e.g. any Intel-based Mac but the very, very earliest).
I don't recall off-hand how it decides which architecture to load for a command-line tool (as opposed to an application bundle).
> /usr/bin/gcc-4.0 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -DAPPLE -I. -I.. -I/<workspace>/include -I/Developer/SDKs/MacOSX10.6.sdk -dynamic -framework DiskArbitration mount.c getmntopts.c -o build-x86_64/mount_fsd
> /Library/Logs/CrashReporter/mount_fsd*.crash shows "Code Type" as "X86-64 (Native)". I do not know if that is relevant/significant. Can anyone give any insight into what might be happening?
It would appear that it's trying to load and execute the x86_64 architecture out of your binary. Since that one uses "-mmacosx-version-min=10.6", the compiler and linker are free to use non-Leopard-compatible extensions to the Mach-O format, including the unrecognized load command.
You can try this to confirm that Leopard is loading the x86_64 architecture and that's the source of the problem:
arch -arch i386 ./mount_fsd
If that works, then mount_fsd's i386 architecture is just fine and Leopard-compatbile in terms of Mach-O load commands.
You could, of course, build with "-mmacosx-version-min=10.5", but then you'd have to be careful to make the code Leopard-compatible. If it's not using any Snow Leopard-specific APIs, the simplest way is to switch to the 10.5 SDK, too.
If you wish to use Snow Leopard features in the x86_64 architecture, and you don't want to go to the trouble of also making it Leopard-compatible with the appropriate conditionals and fallbacks, perhaps somebody else will know of a way to include an x86_64 architecture but prevent Leopard from trying to load 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