X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/4be885f63e03d78a3780e8041f107657f85eb5cb..e456bf1059cf7e6b8b71545d1b2f2092b55a9684:/unit-tests/test-cases/kext-basic/Makefile?ds=sidebyside diff --git a/unit-tests/test-cases/kext-basic/Makefile b/unit-tests/test-cases/kext-basic/Makefile index 6a318b3..e33b66c 100644 --- a/unit-tests/test-cases/kext-basic/Makefile +++ b/unit-tests/test-cases/kext-basic/Makefile @@ -5,25 +5,26 @@ include ${TESTROOT}/include/common.makefile # # Sanity check that ld can link a kext # - +FILE_TYPE = OBJECT ifeq (${ARCH},x86_64) FILE_TYPE = KEXTBUNDLE -else - FILE_TYPE = OBJECT +endif +ifeq (${FILEARCH},arm) + FILE_TYPE = KEXTBUNDLE endif +#CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang run: all all: - ${CC} ${CCFLAGS} -static -fno-common -mkernel -c mykext.c -o mykext.o - ${CC} ${CCFLAGS} -static -fno-common -mkernel -c mykextinfo.c -o mykextinfo.o - ${CC} ${CCFLAGS} -Wl,-kext mykext.o mykextinfo.o -nostdlib -lkmodc++ -lkmod -lcc_kext -o mykext + ${CC} ${CCFLAGS} -static -mkernel -c mykext.c -o mykext.o + ${CC} ${CCFLAGS} -static -mkernel -c mykextinfo.c -o mykextinfo.o + ${CC} ${CCFLAGS} -Wl,-kext mykext.o mykextinfo.o -nostdlib -lkmodc++ -lkmod -lcc_kext -o mykext -Wl,-w -Wl,-new_linker otool -hv mykext | grep ${FILE_TYPE} | ${FAIL_IF_EMPTY} nm -nm mykext | grep '(undefined) external _extern_global' | ${FAIL_IF_EMPTY} nm -nm mykext | grep '(__DATA,__data) external _my_global' | ${FAIL_IF_EMPTY} otool -rv mykext | grep '_extern_global' | ${FAIL_IF_EMPTY} - otool -rv mykext | grep '_OSRuntimeFinalizeCPP' | ${FAIL_IF_EMPTY} ${PASS_IFF} true clean: