Xcode should not allow kexts to have deployment targets older than the base SDK

Originator:jb.rubin
Number:rdar://13519730 Date Originated:3/27/2013
Status:Closed Resolved:
Product:Developer Tools Product Version:4
Classification:Feature Request Reproducible:
 
27-Mar-2013 06:34 PM Jonathon Rubin:
Summary:
Xcode allows a foolish developer to set minimum deployment OS targets for kernel extensions that are older than the linked base SDK's OS. So, for example, it will let you set a deployment target of 10.4 with a base SDK of 10.8. It will merrily go about its job compiling a kext. Even though there is no guarantee it will work. Xcode generates no errors or warnings indicating this. Instead, it should forbid this configuration or at least warn the developers they are being idiots and taking huge risks.

Steps to Reproduce:
In Xcode 4.x, build a 32/64 kext that calls lck_mtx_unlock(). Use a minimum deployment target of 10.4 and a base SDK of 10.8.

Expected Results:
Xcode refuses to allow these settings to persist, or at least warns about them, because they are crazy and do not work.

Actual Results:
Xcode spits out a kext which, when installed on a 10.5 Mac, fails to load:
kld(): Undefined symbols:
_lck_mtx_unlock_darwin10

This is because modern versions of kern/locks.h include this block of code:
#if	defined(__i386__)
extern void	lck_mtx_unlock(lck_mtx_t		*lck) __DARWIN10_ALIAS(lck_mtx_unlock);
#else
extern void				lck_mtx_unlock(
									lck_mtx_t		*lck);
#endif	/* __i386__ */

All of this info is available to Xcode at build time, so it should prevent the developer from shooting themselves in the foot.

Regression:
This is a request for new functionality.

Notes:

Comments

Closed with: "This bug has been closed as Duplicate." and linked to open ticket 7184689.


Please note: 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!