Date: Wed, 23 Mar 2005 21:22:01 -0800 From: Peter Wemm <peter@wemm.org> To: freebsd-amd64@freebsd.org Cc: Vinod Kashyap <vkashyap@amcc.com> Subject: Re: undefined reference to `memset' Message-ID: <200503232122.01937.peter@wemm.org> In-Reply-To: <IDTR9T00.LMF@hadar.amcc.com> References: <IDTR9T00.LMF@hadar.amcc.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 23 March 2005 01:48 pm, Vinod Kashyap wrote:
> If any kernel module has the following, or a similar line in it:
> -----
> char x[100] = {0};
> -----
> building of the GENERIC kernel on FreeBSD 5 -STABLE for amd64
> as of 03/19/05, fails with the following message at the time of
> linking: "undefined reference to `memset'".
>
> The same problem is not seen on i386.
>
> The problem goes away if the above line is changed to:
> -----
> char x[100];
> memset(x, 0, 100);
> -----
>
> Adding CFLAGS+=-fbuiltin, or CFLAGS+=-fno-builtin to
> /sys/conf/Makefile.amd64 does not help.
>
> Anyone knows what's happening?
Something fishy is going on. I've tried this on both 5.x and 6.0 and
both systems created a bss object called 'x', not something that called
memset.
For example:
peter@fb5-amd64[9:17pm]/home/src/sys/modules/twe-21# nm obj/twe.ko |
grep x
U busdma_lock_mutex
U sysctl_ctx_free
U sysctl_ctx_init
0000000000000080 b x
peter@fb5-amd64[9:17pm]/home/src/sys/modules/twe-22# nm obj/twe.ko |
grep memset
peter@fb5-amd64[9:17pm]/home/src/sys/modules/twe-23#
I wondered if it might be because of something like -O2 (don't do that)
or no -O at all, but I couldn't make it happen even then.
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503232122.01937.peter>
