ccache looks at gcc command line and bases the cache on that so we need to keep it static. See HOW IT WORKS in http://ccache.samba.org/ccache-man.html Index: README-builds.html =================================================================== --- README-builds.html (revision 237) +++ README-builds.html (working copy) @@ -1367,7 +1367,10 @@ and the rest of the JDK will often be disk intensive.

Faster compiles are possible using a tool called - ccache. + ccache. To be effectively able to + use ccache set the BUILD_NUMBER environment variable. It by default has the + value of the current date which invalidates the ccache. +