GCCs options -fprofile-generate and -fprofile-use are used for profile guided optimization. It depends on the ability to locate the profile data files (.gcda) after running the executable with the training data. However, ccache prevents the compiler from finding the correct profile data file. Therefore the following patch disables the caching when one of the -fprofile-generate -fprofile-use -fprofile-arcs flags is found. Signed-off-by: Clemens Rabe diff -Naur ccache-2.4.orig/ccache.c ccache-2.4/ccache.c --- ccache-2.4.orig/ccache.c 2004-09-13 12:38:30.000000000 +0200 +++ ccache-2.4/ccache.c 2008-01-07 20:25:38.000000000 +0100 @@ -640,6 +640,9 @@ /* these are too hard */ if (strcmp(argv[i], "-fbranch-probabilities")==0 || + strcmp(argv[i], "-fprofile-generate")==0 || + strcmp(argv[i], "-fprofile-use")==0 || + strcmp(argv[i], "-fprofile-arcs")==0 || strcmp(argv[i], "-M") == 0 || strcmp(argv[i], "-MM") == 0 || strcmp(argv[i], "-x") == 0) {