John Baldwin wrote:
>> I'm seeing this as well:
>>
>> kernel: link_elf_obj: symbol _Z6strlenPKc undefined
>>
>> ...which, I suppose, is the real kldload error message.
>
> Looks like it is trying to use a C++ named-version of strlen():
>
> % echo _Z6strlenPKc | c++filt
> strlen(char const*)
>
> Is the kernel module compiled using c++ instead of cc? 

Here is where the symbol is coming from:

[r...@xwin /usr/ports/emulators/virtualbox-ose-additions]# find . -name
\*.o | while read X; do nm "$X" | grep _Z6strlenPKc && echo $X; done
                 U _Z6strlenPKc
./work/VirtualBox-3.1.2_OSE/out/freebsd.amd64/release/obj/RuntimeGuestR0/common/misc/thread.o
                 U _Z6strlenPKc
./work/VirtualBox-3.1.2_OSE/out/freebsd.amd64/release/obj/RuntimeGuestR0/common/log/log.o
                 U _Z6strlenPKc
./work/VirtualBox-3.1.2_OSE/out/freebsd.amd64/release/obj/RuntimeGuestR0/common/path/RTPathAbsEx.o
                 U _Z6strlenPKc
./work/VirtualBox-3.1.2_OSE/out/freebsd.amd64/release/obj/RuntimeGuestR0/common/path/RTPathAppend.o
                 U _Z6strlenPKc
./work/VirtualBox-3.1.2_OSE/out/freebsd.amd64/release/obj/RuntimeGuestR0/common/string/strformattype.o
                 U _Z6strlenPKc
./work/VirtualBox-3.1.2_OSE/out/freebsd.amd64/release/obj/RuntimeGuestR0/common/string/string.o
[r...@xwin /usr/ports/emulators/virtualbox-ose-additions]#

And here are some presumed source files:

[r...@xwin /usr/ports/emulators/virtualbox-ose-additions]# find . -name
thread.c\*
./work/VirtualBox-3.1.2_OSE/src/VBox/Runtime/common/misc/thread.cpp
./work/VirtualBox-3.1.2_OSE/src/VBox/Additions/x11/VBoxClient/thread.cpp
./work/VirtualBox-3.1.2_OSE/src/libs/xpcom18a4/nsprpub/pr/src/cplus/tests/thread.cpp
[r...@xwin /usr/ports/emulators/virtualbox-ose-additions]#

src/VBox/Runtime/common/misc/thread.cpp contains:

#include <iprt/string.h>

include/iprt/string.h has this:

#elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
# include <sys/libkern.h>

It seems sys/libkern.h is C namespace but thread.cpp or iprt/string.h
isn't using extern "C" to make it that.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[email protected]"

Reply via email to