From owner-freebsd-stable@FreeBSD.ORG Fri Mar 25 22:38:17 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01AA616A4CE; Fri, 25 Mar 2005 22:38:17 +0000 (GMT) Received: from hadar.amcc.com (hadar.amcc.com [192.195.69.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84F4E43D49; Fri, 25 Mar 2005 22:38:16 +0000 (GMT) (envelope-from vkashyap@amcc.com) Received: from mailhost01.amcc.com ([192.195.69.30]) by hadar.amcc.com (Netscape Messaging Server 4.15) with SMTP id IDXIVU00.7WB; Fri, 25 Mar 2005 14:38:18 -0800 Received: (from vkashyap-pc [10.66.6.61]) by mailhost01.amcc.com (SMSSMTP 4.0.0.59) with SMTP id M2005032514414416809 ; Fri, 25 Mar 2005 14:41:44 -0800 From: "Vinod Kashyap" To: obrien@freebsd.org Date: Fri, 25 Mar 2005 14:37:19 -0800 X-Sent-Folder-Path: Sent Items X-Mailer: Oracle Connector for Outlook 9.0.4 51114 (9.0.6627) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=-------64c2860764c28607 Message-ID: cc: freebsd-stable@freebsd.org cc: freebsd-amd64@freebsd.org Subject: RE: undefined reference to `memset' X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2005 22:38:17 -0000 This is a multi-part message in MIME format ---------64c2860764c28607 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > > Can you not submit it with the patch I sent? > = > Submit the entire /usr/src/sys kernel source?? > = > > A "stand alone" foo.c will have to be a new module under a new > > directory (/sys/dev/foo), with its own Makefile, with changes to > > /sys/conf/files, and an entry in GENERIC. > = > A module would still depend on files in /usr/share/mk, = > /usr/src/sys/conf, > /usr/src/sys/modules, /usr/src/sys/dev/foo. > = > NO! nothing other than a single file -- foo.c in my home = > directory that > shows the problem is a "stand alone" example. Here is memset_issue.c (also attached). But note that you cannot reproduce the "undefined reference to `memset'" issue with this (that's what I have been trying to explain). You could also use the earlier posting from Sean McNeil. #include main() { char a[100] =3D {0}; char *ap; ap =3D &(a[0]); printf("a[0] =3D %d\n", a[0]); } With the patch that I sent earlier applied to /sys/dev/twa/twa.c, 'nm twa.o' shows this when twa is built as a stand alone module: 00000000000003f0 t memset 'nm twa.o' shows this when twa is built as part of the kernel: U memset And now, moving to the important thing... in kern.pre.mk, I changed COPTFLAGS from -O2 to -O for amd64 (just like i386), and the problem is gone!! ---------64c2860764c28607 Content-Type: text/plain; name="memset_issue.c" Content-Disposition: attachment; filename="memset_issue.c" Content-Transfer-Encoding: quoted-printable #include main() { char a[100] =3D {0}; char *ap; ap =3D &(a[0]); printf("a[0] =3D %d\n", a[0]); } ---------64c2860764c28607--