]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Rewrite absolute input path to relative
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Mar 2020 21:09:37 +0000 (22:09 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Mar 2020 21:09:37 +0000 (22:09 +0100)
This can now be done due to no longer using realpath in
make_relative_path (e8444a38).

src/ccache.cpp

index 1431ff35c12da2b66218f0b5bb082e1e04aa360b..81779811832aa11c5531ec16071b6123fa968c3a 100644 (file)
@@ -2923,16 +2923,8 @@ process_args(Context& ctx,
       continue;
     }
 
-    if (Stat::lstat(argv[i], Stat::OnError::log).is_symlink()) {
-      // Don't rewrite source file path if it's a symlink since
-      // make_relative_path resolves symlinks using realpath(3) and this leads
-      // to potentially choosing incorrect relative header files. See the
-      // "symlink to source file" test.
-      args_info.input_file = from_cstr(argv[i]);
-    } else {
-      // Rewrite to relative to increase hit rate.
-      args_info.input_file = make_relative_path(ctx, argv[i]);
-    }
+    // Rewrite to relative to increase hit rate.
+    args_info.input_file = make_relative_path(ctx, argv[i]);
   } // for
 
   if (generating_debuginfo_level_3 && !config.run_second_cpp()) {