XCode 4.5 builds invalid 32-bit kext binaries
||Date Originated:||22-Sep-2012 09:56 PM|
i386 kernel extension binaries built by XCode 4.5 contain the loader commands LC_DATA_IN_CODE and LC_FUNCTION_STARTS. Neither of these is supported by kxld in kernels older than OSX 10.8. The kexts built this way are therefore rejected by OSX Lion, Snow Leopard, etc.
Steps to Reproduce:
- Open XCode
- File -> New -> Project…
- Choose "I/O Kit Driver"
- Complete the assistant
- Set the target's deployment target to 10.7 or earlier
- Set architectures to Intel 32/64-bit.
- Build the 32-bit version (or a fat 32+64-bit binary)
- Run the terminal command:
otool -lV -arch i386 /path/to/kext/Contents/MacOS/binary_name
No unsupported commands should be listed.
Near the end, LC_DATA_IN_CODE and LC_FUNCTION_STARTS commands are present.
If you open and build the same project using XCode 4.4.1 or earlier, the produced kexts are fine.
- It does not matter whether XCode 4.5 is running on OS X 10.7 or 10.8, the produced kexts are always bad.
- The 64-bit versions are not affected and do not contain the relevant commands.
- An affected "fat" kext can be loaded on a 64-bit system, but it seems to interfere with kernel prelinking.
- Relevant thread in the darwin-kernel mailing list: http://lists.apple.com/archives/darwin-kernel/2012/Sep/msg00025.html
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!