kextload failure on 10.5
kextload failure on 10.5
- Subject: kextload failure on 10.5
- From: mogambo <email@hidden>
- Date: Fri, 23 Apr 2010 15:42:11 -0700
Hi,
We have a file system driver kext that we build with make. We build two separate versions for 32- and 64-bit OS X since last year when 10.6 was released. I did some tweaks to the Makefile and was able to build a UB on 10.6.2 x86_64 machine containing code for all 3 architectures we support - ppc, i386 and x86_64. I was able to load the same kext on 10.4/ppc, 10.6/i386 and 10.6/x86_64.
When I tried to load the same kext on a 10.5.7/i386, it failed with the following errors:
$ sudo kextload fsd.kext
kld(): Undefined symbols:
___stack_chk_fail
___stack_chk_guard
_lck_mtx_unlock_darwin10
kextload: kld_load_from_memory() failed for module /Users/apple/fsd-47.107/fsd.kext/Contents/MacOS/fsd
kextload: a link/load error occured for kernel extension fsd.kext
link/load failed for extension fsd.kext
(run kextload with -t for diagnostic output)
I added -fno-stack-protector to gcc, which got rid of stack_chk{fail,guard} errors. However, _lck_mtx_unlock_darwin10 persists.
Here's the gcc command line:
gcc -arch ppc -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.4 -g -static -nostdinc -Wall -Wno-switch -fno-stack-protector -msoft-float -mlong-branch -force_cpusubtype_ALL -fno-builtin -DKERNEL -DAPPLE -D__KERNEL__ -DKERNEL_PRIVATE -DOPENSSL_NO_STDIO -DOPENSSL_NO_ENGINE -DOPENSSL_NO_FP_API -DOPENSSL_NO_SHA256 -DOPENSSL_NO_SHA512 -DOPENSSL_NO_ASM -DNO_OLD_ASN1 -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_BIO -DPROFILE -DOPENSSL_NO_ERR -I. -I.. -I/System/Library/Frameworks/Kernel.framework/Headers -I/System/Library/Frameworks/Kernel.framework/Headers/bsd -I/Users/apple/workspace/include -I/Developer/SDKs/MacOSX10.6.sdk -I/usr/include/sys -c probe.c -o probe.o
The linker command line:
gcc -arch ppc -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.4 -static -Wall -nostdlib -r -lkmod -lkmodc++ -lcc_kext -Xlinker -kext -o fsd <list of .o files>
Any ideas?
Thanks!
-m.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden