Re: kextload failure on 10.5
Re: kextload failure on 10.5
- Subject: Re: kextload failure on 10.5
- From: mogambo <email@hidden>
- Date: Mon, 26 Apr 2010 15:45:21 -0700
Hi Nik,
Here are my findings:
On the 10.6/64-bit where I build the supposed UB:
# nm fsd.kext/Contents/MacOS/fsd | grep darwin10
U _lck_mtx_unlock_darwin10
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.5.7
BuildVersion: 9J61
$ nm fsd.kext/Contents/MacOS/fsd
-bash: nm: command not found
$ kextfind -dsym _lck_mtx_unlock_darwin10
$ <no results>
Yes, com.apple.kernel.libkern is in my OSBundleLibraries. kextfind does not find the symbols on 10.5, which is what I'd expect since it's already failing with Undefined Symbol error on 10.5. Somehow on 10.4 it is able to resolve the symbols. I could not find kextfind on 10.4, so could not check what defines the symbols there.
I'd be happy to provide all I can to get to the bottom of this issue. What internals do you need for my kext?
Thanks,
-m.
On Mon, Apr 26, 2010 at 1:47 PM, Nik Gervae
<email@hidden> wrote:
I'm not set up at the moment to diagnose problems *on* 10.5, but I could check your kext's internals if you want to send it.
Some things you could try are:
nm fsd.kext
kextfind -dsym _lck_mtx_unlock_darwin10
The first dumps all the symbols, so you can double check the nature of _lck_mtx_unlock_darwin10 (it's probably undefined but maybe there's a weird problem internally). The kextfind command should find which kext (if any) defines the symbol that's failing to link: on my Snow Leopard system it says Libkern.kext (com.apple.kpi.libkern, not com.apple.kernel.libkern) is the one that defines it for i386. Is that in your OSBundleLibraries?
I'll have to dig out a 10.5. disk to run kextfind myself, but you can probably do that directly.
Nik Gervae
Kext Management Engineer
Apple, Inc.
On 23 Apr, 2010, at 15:42 , mogambo wrote:
> 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
_______________________________________________
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