Related: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=173914 I was able to do `make buildworld` successfully. However, I had to `installworld` like this: sudo make installworld COMPILER_TYPE=clang Other relation: https://svnweb.freebsd.org/ports?view=revision&revision=316346 Maybe COMPILER_TYPE should have a helper for `installworld` too? $ freebsd-version -ku; uname -apKU 11.0-CURRENT 11.0-CURRENT FreeBSD z600 11.0-CURRENT FreeBSD 11.0-CURRENT #6: Sun Sep 13 22:16:54 CDT 2015 root@z600:/usr/obj/usr/src/sys/MYKERNEL amd64 amd64 1100079 1100079 $ pkg info ccache ccache-3.2.3 Name : ccache Version : 3.2.3 Installed on : Wed Sep 9 18:10:31 CDT 2015 Origin : devel/ccache Architecture : freebsd:11:x86:64 <chop> $ cat /etc/make.conf MALLOC_PRODUCTION=1 .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) .if !defined(NOCCACHE) && exists(/usr/local/libexec/ccache/world/cc) CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1} CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1} .endif .endif $ cat /etc/profile LANG=en_US.UTF-8; export LANG CHARSET=UTF-8; export CHARSET GDM_LANG=en_US.UTF-8; export GDM_LANG export CCACHE_DIR=/usr/.ccache export PATH=/usr/local/libexec/ccache:$PATH export CCACHE_PATH=/usr/bin:/usr/local/bin export CCACHE_MAXSIZE=10
Strange, I have not run into this and use ccache in installworld frequently.
Actually I just noticed I have 'COMPILER_TYPE=clang' in my make.conf for CCACHE. I should update the example configuration. As a side note, the current support is not very good and needs to be rethought to avoid issues like this and the XCC one.
I'm working on a more official support for ccache in buildworld. The WIP is at https://reviews.freebsd.org/D3736
This should be fixed by the following, without needing to set COMPILER_TYPE: r290417 | imp | 2015-11-05 13:48:12 -0800 (Thu, 05 Nov 2015) | 10 lines Fix CC being wrong during install* targets. Move CROSS_TOOLS stuff to top of file (before bsd.compiler.mk) so that decisions made by bsd.compiler.mk can properly affect the defaults in src.opts.mk. Move that to after bsd.compiler.mk. Add a comment about why we include bsd.compiler.mk here despite the fact that src.opts.mk currently does too. Also remove bsd.arch.inc.mk that's been OBE. Differential Revision: https://reviews.freebsd.org/D4087