Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2005 12:46:41 -0800
From:      "Vinod Kashyap" <vkashyap@amcc.com>
To:        obrien@freebsd.org
Cc:        freebsd-amd64@freebsd.org
Subject:   RE: undefined reference to `memset'
Message-ID:  <IDVJ3H01.CW0@hadar.amcc.com>

next in thread | raw e-mail | index | archive | help

Ok, make sure you have 'device twa' in your kernel configuration
file, and apply these patches to /sys/dev/twa/twa.c.


This patch causes the problem:

--- twa.c.org	Wed Mar 23 11:13:49 2005
+++ twa.c	Thu Mar 24 12:42:23 2005
@@ -366,9 +366,12 @@
 	int8_t		fw_flashed =3D FALSE;
 	int8_t		fw_flash_failed =3D FALSE;
 #endif /* TWA_FLASH_FIRMWARE */
+	int8_t		tw_expt[100] =3D {0};
+	int8_t		*tw_expt_ptr;
 =

 	twa_dbg_dprint_enter(3, sc);
 =

+	tw_expt_ptr =3D &(tw_expt[0]);
 	/* Wait for the controller to become ready. */
 	if (twa_wait_status(sc, TWA_STATUS_MICROCONTROLLER_READY,
 					TWA_REQUEST_TIMEOUT_PERIOD)) {



This patch does not cause the problem:

--- twa.c.org	Wed Mar 23 11:13:49 2005
+++ twa.c	Thu Mar 24 12:36:10 2005
@@ -366,9 +366,13 @@
 	int8_t		fw_flashed =3D FALSE;
 	int8_t		fw_flash_failed =3D FALSE;
 #endif /* TWA_FLASH_FIRMWARE */
+	int8_t		tw_expt[100]/* =3D {0}*/;
+	int8_t		*tw_expt_ptr;
 =

 	twa_dbg_dprint_enter(3, sc);
 =

+	memset(tw_expt, 0, 100);
+	tw_expt_ptr =3D &(tw_expt[0]);
 	/* Wait for the controller to become ready. */
 	if (twa_wait_status(sc, TWA_STATUS_MICROCONTROLLER_READY,
 					TWA_REQUEST_TIMEOUT_PERIOD)) {


> -----Original Message-----
> From: David O'Brien [mailto:obrien@FreeBSD.ORG]
> Sent: Thursday, March 24, 2005 12:21 PM
> To: Vinod Kashyap
> Cc: freebsd-amd64@freebsd.org
> Subject: Re: undefined reference to `memset'
> =

> =

> On Thu, Mar 24, 2005 at 06:05:17PM +1100, Peter Jeremy wrote:
> > On Wed, 2005-Mar-23 13:48:04 -0800, Vinod Kashyap wrote:
> > >If any kernel module has the following, or a similar line in it:
> > >-----
> > >char x[100] =3D {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);
> > >-----
> > =

> > Can you post a complete (compilable) example please.
> =

> Vinod can you please post a complete compilable example?
> It is impossible to get anything done about your issue without stand
> alone test code.
> =

> -- =

> -- David    (obrien@FreeBSD.org)
> 




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