first time module dev question: undefined reference to 'memset'

John Baldwin jhb at freebsd.org
Fri Sep 21 14:40:27 PDT 2007


On Friday 21 September 2007 09:27:03 am Michael Iedema wrote:
> Greetings everyone,
> 
> I'm undertaking the seemingly simple task of porting a Linux kernel
> module to FreeBSD. I say simple because it is merely a wrapper used to
> expose some functions to another module.
> 
> The code I'm porting is OSLEC[1] a line echo canceller module that is
> used by Zaptel and Asterisk. My current problem is an undefined
> reference to 'memset' when I attempt to load the cleanly compiled
> module.
> 
> There is a lengthy discussion about this error here[2] but I could
> find no conclusive remedy. My wrapper module links with code from
> another library and it is causing the problems in kernel land.
> 
> Here is my module so far: http://pastebin.ca/705865
> ...and my broken Makefile: http://pastebin.ca/705871
> 
> If anyone could point me in the right direction it would be very
> appreciated. I realize that I am out of my league dealing with kernel
> modules but the porting process looked easy enough. As with most new
> adventures, this has proved untrue.

I think you need to add a memset() function in your module.  The kernel 
doesn't include memset() in 6.x.  You can backport the one in 7.x (look in 
sys/libkern) if you want.

-- 
John Baldwin


More information about the freebsd-drivers mailing list