From: Joel Rosdahl Date: Mon, 2 Nov 2009 18:01:12 +0000 (+0100) Subject: Don't hash CCACHE_PREFIX X-Git-Tag: v3.0pre0~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e289678ff80ff76abdc8de651ad5a048ae99cbc1;p=thirdparty%2Fccache.git Don't hash CCACHE_PREFIX --- diff --git a/NEWS b/NEWS index 98b0dedaa..bd17b17ff 100644 --- a/NEWS +++ b/NEWS @@ -45,3 +45,5 @@ Bug fixes: - Corrected documentation about sharing the cache directory. - Fixed compilation warnings from GCC 4.3. + + - The command specified by CCACHE_PREFIX is no longer part of the hash. diff --git a/ccache.c b/ccache.c index 99b3ff7be..5967991fe 100644 --- a/ccache.c +++ b/ccache.c @@ -656,7 +656,6 @@ static void process_args(int argc, char **argv) int found_c_opt = 0; int found_S_opt = 0; struct stat st; - char *e; /* is gcc being asked to output dependencies? */ int generating_dependencies = 0; /* is the dependency makefile name overridden with -MF? */ @@ -907,20 +906,13 @@ static void process_args(int argc, char **argv) stats_update(STATS_DEVICE); failed(); } - - if ((e=getenv("CCACHE_PREFIX"))) { - char *p = find_executable(e, MYNAME); - if (!p) { - perror(e); - exit(1); - } - args_add_prefix(stripped_args, p); - } } /* the main ccache driver function */ static void ccache(int argc, char *argv[]) { + char *prefix; + /* find the real compiler */ find_compiler(argc, argv); @@ -955,6 +947,16 @@ static void ccache(int argc, char *argv[]) failed(); } + prefix = getenv("CCACHE_PREFIX"); + if (prefix) { + char *p = find_executable(prefix, MYNAME); + if (!p) { + perror(prefix); + exit(1); + } + args_add_prefix(stripped_args, p); + } + /* run real compiler, sending output to cache */ to_cache(stripped_args);