Using ccache for build{world, kernel}

Steve Hodgson steve at acidy.com
Tue Nov 15 14:11:07 PST 2005


Nicolas Blais wrote:

>On November 15, 2005 04:14 pm, Jens Schweikhardt wrote:
>  
>
>>Folks,
>>
>># Put this in /usr/ports/devel/ccache/files/patch-nohash-size-mtime and
>># reinstall the port. Then export CCACHE_NOHASH_SIZE_MTIME=y during your
>># makes for buildworld and buildkernel. This melts my buildworld time
>># from 2700s (real@~100%CPU) to under 1000s and buildkernel from 800s
>># to 250s, so you gain about a factor 3 for ab-initio builds. Sweet!
>>#
>>#
>># --- ccache.c.orig	Mon Oct 31 17:38:21 2005
>># +++ ccache.c	Mon Oct 31 17:52:31 2005
>># @@ -331,8 +331,10 @@
>>#  		hash_string(str_basename(args->argv[0]));
>>#  	}
>>#
>># -	hash_int(st.st_size);
>># -	hash_int(st.st_mtime);
>># +	if (!getenv("CCACHE_NOHASH_SIZE_MTIME")) {
>># +		hash_int(st.st_size);
>># +		hash_int(st.st_mtime);
>># +	}
>>[Rest of patch snipped ...]
>>
>>I just asked the devel/ccache maintainer to commit this patch and he
>>promptly did (Thanks Michael Johnson, aka ahze!). So you only need this
>>unless your ports tree is current as of now.
>>
>>Regards,
>>
>>	Jens
>>    
>>
>
>Thanks, very helpful!
>
>  
>
So would the following form a better set of instructions for the port
(given the above patch is merged)?

1. don't follow the instructions about changing your PATH and setting
CCACHE_PATH in /etc/profile or cshrc
2. use the following in /etc/make.conf

.if !defined(NOCCACHE)
.if ${.CURDIR:M/usr/src*}
CC=CCACHE_NOHASH_SIZE_MTIME=y /usr/local/bin/ccache cc
CXX=CCACHE_NOHASH_SIZE_MTIME=y /usr/local/bin/ccache c++
.else
CC=/usr/local/bin/ccache cc
CXX=/usr/local/bin/ccache c++
.endif
.endif

(untested though)

Steve



More information about the freebsd-current mailing list