Along the same lines as my last post, ccache 3.0 (pre-release, but hasn't given me any problems) is a big win over previous versions. In particular, it can share cached object files between Mozilla tress, no hackery required.

(Even if you specify all your -I directories to gcc using relative paths, the -g argument, which enables debug symbols, causes gcc to emit an absolute path to the source file in the preprocessed output, presumably so the debugger knows where to find the source. Older versions of ccache wouldn't rewrite this absolute path, and thus would consider two identical files in two different directories as not matching. So compiling with debug symbols precluded you from sharing between trees before ccache 3.0.)

Alas, hardlinking with multiple trees still doesn't work quite right.