]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don't hash compiler option -fdebug-prefix-map=
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 8 Jan 2014 19:29:33 +0000 (20:29 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 8 Jan 2014 19:33:31 +0000 (20:33 +0100)
The -fdebug-prefix-map option may be used in combination with
CCACHE_BASEDIR to reuse results across different directories.

Based on a patch by Pawel Sikora.

ccache.c

index 73d86eda9ec4d3dea74aa5bd6c36b81df28e1d98..6069584a6363110f645c8498eebd3b60d8f7f6ff 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -2,7 +2,7 @@
  * ccache -- a fast C/C++ compiler cache
  *
  * Copyright (C) 2002-2007 Andrew Tridgell
- * Copyright (C) 2009-2013 Joel Rosdahl
+ * Copyright (C) 2009-2014 Joel Rosdahl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -971,6 +971,13 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                        continue;
                }
 
+               /* The -fdebug-prefix-map option may be used in combination with
+                  CCACHE_BASEDIR to reuse results across different directories. Skip it
+                  from hashing. */
+               if (str_startswith(args->argv[i], "-fdebug-prefix-map=")) {
+                       continue;
+               }
+
                /* When using the preprocessor, some arguments don't contribute
                   to the hash. The theory is that these arguments will change
                   the output of -E if they are going to have any effect at