From owner-freebsd-ports@FreeBSD.ORG Tue Mar 21 13:26:43 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D07A16A401 for ; Tue, 21 Mar 2006 13:26:43 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from andxor.it (relay.andxor.it [195.223.2.3]) by mx1.FreeBSD.org (Postfix) with SMTP id A395443D64 for ; Tue, 21 Mar 2006 13:26:39 +0000 (GMT) (envelope-from ale@FreeBSD.org) Received: (qmail 35261 invoked from network); 21 Mar 2006 13:26:36 -0000 Received: from unknown (HELO ?192.168.178.2?) (a.premoli@andxor.it@81.174.31.42) by andxor.it with SMTP; 21 Mar 2006 13:26:36 -0000 Message-ID: <441FFF0C.4010107@FreeBSD.org> Date: Tue, 21 Mar 2006 14:26:36 +0100 From: Alex Dupre User-Agent: Thunderbird 1.5 (X11/20060301) MIME-Version: 1.0 To: freebsd-current@FreeBSD.org, freebsd-ports@freebsd.org, ahze@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Using ccache with make world X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2006 13:26:43 -0000 Short summary: I made a patch to ccache port so that we can actually and effectively use ccache when making buildworld and buildkernel. The patch can be found at: http://www.alexdupre.com/ccache.diff Read the ccache-freebsd-howto.txt file before using ccache. Long description: As you know, until now, building FreeBSD with ccache spotted several issues because of the complex "make world" process; in particular it changes the default path and build a new compiler with different header files and this avoids any effective use of ccache. Some workarounds grew up, but they fix only a subset of the problems, creating (sooner or later) issues elsewhere. This patch tries to fix (or at least minimize) all the problems, implementing a mixture of floating ideas collected from various threads. For an implementation overview, I recommend to read the simple patch, because explaining it will be more complex for me :-) Benchmarks: Just booted into a new world/kernel, compiled (and installed) for the first time with ccache. /usr/obj is empty. # ccache -s cache directory /usr/.ccache cache hit 932 cache miss 16144 called for link 755 multiple source files 1 compile failed 107 preprocessor error 35 not a C/C++ file 1550 autoconf compile/link 807 unsupported compiler option 546 no input file 116 files in cache 32288 cache size 219.7 Mbytes max cache size 976.6 Mbytes # time make buildworld [...] 547.504u 206.484s 18:02.28 69.6% 2792+1865k 38436+7220io 6874pf+0w # ccache -s cache directory /usr/.ccache cache hit 13027 cache miss 16265 called for link 1311 multiple source files 2 compile failed 107 preprocessor error 35 not a C/C++ file 2759 autoconf compile/link 807 unsupported compiler option 546 no input file 117 files in cache 32530 cache size 220.0 Mbytes max cache size 976.6 Mbytes # time make buildkernel [...] 125.756u 47.537s 5:03.57 57.0% 2664+1990k 13871+4882io 715pf+0w # ccache -s cache directory /usr/.ccache cache hit 15070 cache miss 16268 called for link 1314 multiple source files 2 compile failed 107 preprocessor error 35 not a C/C++ file 2763 autoconf compile/link 807 unsupported compiler option 552 no input file 117 files in cache 32536 cache size 220.2 Mbytes max cache size 976.6 Mbytes -- Alex Dupre