]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
include the compiler name in the hash if the link count on the
authorAndrew Tridgell <tridge@samba.org>
Mon, 13 Sep 2004 10:19:06 +0000 (12:19 +0200)
committerAndrew Tridgell <tridge@samba.org>
Mon, 13 Sep 2004 10:19:06 +0000 (12:19 +0200)
compiler is > 1, to cope with compilers (like the AIX one) that
changes behaviour based on argv[0].

Thanks to Nicholas Clark <nick@ccl4.org> for pointing out this problem

ccache.c

index ace986d1f239067423573141a5e783e09e37862e..c15ced54f393d8f126a4cbfee1499cc197e19486 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -324,6 +324,13 @@ static void find_hash(ARGS *args)
                stats_update(STATS_COMPILER);
                failed();
        }
+
+       /* also include the hash of the compiler name - as some compilers
+          use hard links and behave differently depending on the real name */
+       if (st.st_nlink > 1) {
+               hash_string(str_basename(args->argv[0]));
+       }
+
        hash_int(st.st_size);
        hash_int(st.st_mtime);