[ccache] -Bprefix compiler option - resulting in cache miss

vkr venkatakrishnarao.ks at gmail.com
Fri Sep 11 10:02:51 UTC 2015

I believe I found a potential bug with ccache that results in cache-miss if
-Bprfix compilation option is used, where prefix specifies where to find
the executables, libraries, include files, and data files of the compiler

Example, if my compilation command is:
CCACHE_BASEDIR=$PWD ccache gcc -c hello.c -o hello.o

then, from what I understand, ccache is considering this argument
as well, while creating the basic-hash for direct cache lookup, but without
rewriting it into its relative path based on CCACHE_BASEDIR setting.
Thus, the hash so generated is for the absolute path of this workspace, and
cannot be reused from another build sandbox.

I verified that the changes done in the fork
fixes the problem.

To verify that -Bprefix is also put into the hash, with its absolute path,
I put a debug statement on the line

Please help to verify my understanding and the fix.


More information about the ccache mailing list