undefined reference to `memset'

Sean McNeil sean at mcneil.com
Thu Mar 24 19:15:04 PST 2005


On Thu, 2005-03-24 at 19:01 -0800, Vinod Kashyap wrote:
> Just like the problem is not seen when I build only the module, it's
> not seen if I simply write a foo.c (with the example code) and compile it.
> That's the reason I posted the patch to /sys/dev/twa/twa.c, which would
> cause the problem if applied, and then followed with a kernel build.
> I can send the result of running nm on twa.o tomorrow.

Please take a look at other messages in this thread, like some of the
ones I have posted.  They clearly show your problem in a small example
and how it is happening in the -O2 case as memset is being optimized
away.  -O would appear to do the right thing and adding
-minline-all-stringops (at either optimization level) would produce even
better code.


More information about the freebsd-stable mailing list