Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2007 15:37:21 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-drivers@freebsd.org
Subject:   Re: first time module dev question: undefined reference to 'memset'
Message-ID:  <200709211537.21584.jhb@freebsd.org>
In-Reply-To: <d3dd0e360709210627o78db23e4o8255478e96a7d1e9@mail.gmail.com>
References:  <d3dd0e360709210627o78db23e4o8255478e96a7d1e9@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709211537.21584.jhb>