3 include ${TESTROOT}/include/common.makefile
6 # Sanity check that ld can link a kext
10 FILE_TYPE = KEXTBUNDLE
12 ifeq (${FILEARCH},arm)
13 FILE_TYPE = KEXTBUNDLE
16 #CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang
21 ${CC} ${CCFLAGS} -static -mkernel -c mykext.c -o mykext.o
22 ${CC} ${CCFLAGS} -static -mkernel -c mykextinfo.c -o mykextinfo.o
23 ${CC} ${CCFLAGS} -Wl,-kext mykext.o mykextinfo.o -nostdlib -lkmodc++ -lkmod -lcc_kext -o mykext -Wl,-w -Wl,-new_linker
24 otool -hv mykext | grep ${FILE_TYPE} | ${FAIL_IF_EMPTY}
25 nm -nm mykext | grep '(undefined) external _extern_global' | ${FAIL_IF_EMPTY}
26 nm -nm mykext | grep '(__DATA,__data) external _my_global' | ${FAIL_IF_EMPTY}
27 otool -rv mykext | grep '_extern_global' | ${FAIL_IF_EMPTY}
31 rm -f mykext.o mykextinfo.o mykext