Re: buildworld + ccache trouble

From: Bartosz Stec <admin_at_kkip.pl>
Date: Mon, 20 Sep 2010 15:05:24 +0200
  W dniu 2010-09-20 12:27, Maxim Khitrov pisze:
> On Mon, Sep 20, 2010 at 4:43 AM, Dmitry Krivenok
> <krivenok.dmitry_at_gmail.com>  wrote:
>> Your patch works fine for me, thanks!
>> However, I don't see any performance gain when using ccache:
>>
>> Number of cache hits is very low.
>> I need to understand this...
> Make sure you have the following environment variables set:
>
> CCACHE_HASH_COMPILER=1       (2.4)
> CCACHE_COMPILERCHECK=content (3.0+)
>
It's unnecesary as long as he has

    CC=/usr/local/libexec/ccache/world-cc
    CXX=/usr/local/libexec/ccache/world-c++

in make.conf because these files already take care about this:

    #!/bin/sh
    unset CCACHE_PATH
    export CCACHE_COMPILERCHECK=content
    exec /usr/local/libexec/ccache/c++ "$_at_"

I don't know if following solution is a dirty hack or proper approach but I found this on list some months ago and it works for me. Here's a part of my make.conf which deals about world building (look at CC:= and CXX:= difference):

    # default build settings for base system
    .if ${.CURDIR:M*/usr/src/*} || ${.CURDIR:M*/usr/obj/*} &&
    !defined(NOCCACHE)

    #CC=/usr/local/libexec/ccache/world-cc
    #CXX=/usr/local/libexec/ccache/world-c++
    CC:=${CC:C,^cc,/usr/local/libexec/ccache/world-cc,1}
    CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world-c++,1}

    CFLAGS=-O2 -pipe
    COPTFLAGS=-O2 -pipe
    .endif


-- 
Bartosz Stec
Received on Mon Sep 20 2010 - 11:05:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:07 UTC