From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 22 01:14:45 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06C2A106566B for ; Thu, 22 Jan 2009 01:14:45 +0000 (UTC) (envelope-from neldredge@math.ucsd.edu) Received: from euclid.ucsd.edu (euclid.ucsd.edu [132.239.145.52]) by mx1.freebsd.org (Postfix) with ESMTP id D93608FC1A for ; Thu, 22 Jan 2009 01:14:44 +0000 (UTC) (envelope-from neldredge@math.ucsd.edu) Received: from zeno.ucsd.edu (zeno.ucsd.edu [132.239.145.22]) by euclid.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id n0M1Eio15560; Wed, 21 Jan 2009 17:14:44 -0800 (PST) Received: from localhost (neldredg@localhost) by zeno.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id n0M1Ei706522; Wed, 21 Jan 2009 17:14:44 -0800 (PST) X-Authentication-Warning: zeno.ucsd.edu: neldredg owned process doing -bs Date: Wed, 21 Jan 2009 17:14:44 -0800 (PST) From: Nate Eldredge X-X-Sender: neldredg@zeno.ucsd.edu To: Andrew Brampton In-Reply-To: Message-ID: References: <4977B357.2080500@andric.com> <20090121185245.00739316@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel Module - GCC Requires memmove X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 01:14:45 -0000 On Thu, 22 Jan 2009, Andrew Brampton wrote: > 2009/1/21 Alexander Kabaev : >> From GCC's info pages: >> >> Most of the compiler support routines used by GCC are present in >> `libgcc', but there are a few exceptions. GCC requires the >> freestanding environment provide `memcpy', `memmove', `memset' and >> `memcmp'. >> >> >> We do not provide all necessary functions in kernel and mostly depend >> on luck for the kernel to link. Your luck apparently ran out :( >> > > Thanks for the info, good thing I'm not a gambling man. Anyway I also > read that part of the GCC manual, so my next question is: If code can > be generated with those four functions, why are they not exported by > the kernel? Surely another kernel module will at some point also be > hit by this? Possibly because the kernel is usually compiled with optimization, in which case the compiler presumably generates inline code for these functions. I vaguely recall Linux having a policy that compiling the kernel without optimization was not supported, possibly because of situations like this. -- Nate Eldredge neldredge@math.ucsd.edu