]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Support gcc-8 -ffile-prefix-map
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Wed, 7 Nov 2018 15:20:24 +0000 (16:20 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 7 Nov 2018 19:38:25 +0000 (20:38 +0100)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

src/ccache.c

index bade8470f693791959792623480d40ecebe5930d..e77755e81946a5d3a11acfc08af4ae9ecca38ecb 100644 (file)
@@ -1786,6 +1786,12 @@ calculate_object_hash(struct args *args, struct hash *hash, int direct_mode)
                if (str_startswith(args->argv[i], "-fdebug-prefix-map=")) {
                        continue;
                }
+               if (str_startswith(args->argv[i], "-ffile-prefix-map=")) {
+                       continue;
+               }
+               if (str_startswith(args->argv[i], "-fmacro-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
@@ -2449,11 +2455,12 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                        args_add(stripped_args, argv[i]);
                        continue;
                }
-               if (str_startswith(argv[i], "-fdebug-prefix-map=")) {
+               if (str_startswith(argv[i], "-fdebug-prefix-map=") ||
+                   str_startswith(argv[i], "-ffile-prefix-map=")) {
                        debug_prefix_maps = x_realloc(
                                debug_prefix_maps,
                                (debug_prefix_maps_len + 1) * sizeof(char *));
-                       debug_prefix_maps[debug_prefix_maps_len++] = x_strdup(argv[i] + 19);
+                       debug_prefix_maps[debug_prefix_maps_len++] = x_strdup(&argv[i][argv[i][2] == 'f' ? 18 : 19]);
                        args_add(stripped_args, argv[i]);
                        continue;
                }