3 include ${TESTROOT}/include/common.makefile
6 # Sanity check that ld can link a kext
10 FILE_TYPE = KEXTBUNDLE
19 ${CC} ${CCFLAGS} -static -fno-common -mkernel -c mykext.c -o mykext.o
20 ${CC} ${CCFLAGS} -static -fno-common -mkernel -c mykextinfo.c -o mykextinfo.o
21 unset LD_NO_CLASSIC_LINKER_STATIC && ${CC} ${CCFLAGS} -Wl,-kext mykext.o mykextinfo.o -nostdlib -lkmodc++ -lkmod -lcc_kext -o mykext -Wl,-w
22 otool -hv mykext | grep ${FILE_TYPE} | ${FAIL_IF_EMPTY}
23 nm -nm mykext | grep '(undefined) external _extern_global' | ${FAIL_IF_EMPTY}
24 nm -nm mykext | grep '(__DATA,__data) external _my_global' | ${FAIL_IF_EMPTY}
25 otool -rv mykext | grep '_extern_global' | ${FAIL_IF_EMPTY}
29 rm -f mykext.o mykextinfo.o mykext