From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 16:05:42 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C9401065670; Fri, 27 Feb 2009 16:05:42 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 093718FC0A; Fri, 27 Feb 2009 16:05:37 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA17962; Fri, 27 Feb 2009 18:05:34 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <49A80F4D.8000406@icyb.net.ua> Date: Fri, 27 Feb 2009 18:05:33 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: Roman Divacky References: <20090227131155.GE19161@hoeg.nl> <20090227131221.GA60215@freebsd.org> In-Reply-To: <20090227131221.GA60215@freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: Ed Schouten , FreeBSD Arch Subject: Re: Making LLVM happy: memmove() in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2009 16:05:42 -0000 on 27/02/2009 15:12 Roman Divacky said the following: > On Fri, Feb 27, 2009 at 02:11:55PM +0100, Ed Schouten wrote: >> Hi all, >> >> The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() by >> itself. I have yet to confirm this, but I assume this is done when >> performing copies of structs greater than a certain size. In our kernel, >> we don't have a memmove() function, but we do have a bcopy(). > > also.. quoting from > (http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Standards.html): > > 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 were just lucky to not run into this Some people actually were not that lucky and had to use similar workarounds. -- Andriy Gapon