That breaks dependencies when the makefile runs with its current directory different from its object directory - for instance glibc does this. Reproducible: Always Steps to Reproduce: 1. mkdir testxyz 2. touch foo.c 3. gcc foo.c -c -o `pwd`/foo.o -MD foo.d will say: /this/directory/foo.o: foo.c 4. ccache gcc foo.c -c -o `pwd`/foo.o -MD foo.d will say: foo.o: foo.c Actual Results: If you use -MD '*.d' files are in source folder Expected Results: If you use -MD '*.d' files should be in target (binaries) folder This is exactly the same problem as reported here in debian bus: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=217713 Also my bug report is almost all copy and paste from debian report. It is the same issue and I verified the wrong behaviour.
Hmm ... I believe this is the patch for fixing this issue: http://lists.samba.org/archive/ccache/2006q4/000249.html
ive pushed the issue upstream (among all the other outstanding Gentoo patches)
fix should be included with ccache-3.0
ccache-3.1.1 in the tree which should fix this