From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 24 07:05:24 2005 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3B9D16A4CE; Thu, 24 Mar 2005 07:05:24 +0000 (GMT) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 275BE43D46; Thu, 24 Mar 2005 07:05:24 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) j2O75Jer026071 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Mar 2005 18:05:20 +1100 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])j2O75I7l043183; Thu, 24 Mar 2005 18:05:18 +1100 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)j2O75HjZ043182; Thu, 24 Mar 2005 18:05:17 +1100 (EST) (envelope-from pjeremy) Date: Thu, 24 Mar 2005 18:05:17 +1100 From: Peter Jeremy To: Vinod Kashyap Message-ID: <20050324070516.GA43123@cirb503493.alcatel.com.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i cc: freebsd-stable@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: undefined reference to `memset' X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2005 07:05:25 -0000 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] = {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. Based on your second example, I suspect that you are putting the variable declaration inside a function definition - the second example doesn't make sense outside a function. If I add "char x[100] = {0};" into a function on i386 and compile it as a kernel module on 5.3, a static memset symbol is generated - it's possible that the amd64 compiler gets confused about the implicit reference to memset that this code needs. -- Peter Jeremy