[PATCH] D37954: Expand absolute system header paths when using -MD depfiles

Peter Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 17 14:56:22 PDT 2017


Lekensteyn added a comment.

In https://reviews.llvm.org/D37954#873373, @joerg wrote:

> Resolving the path doesn't necessary shorten the string at all, in many cases it will be longer.


The description was based on the GCC manual page (" When preprocessing, do not shorten system header paths with canonicalization.")
Maybe something like:
"Do not canonicalize absolute system header paths in depfiles"

> I'm really not sure if clang should resolve symlinks like this as it can be quite surprising.

This provides compatibility with GCC and fixes a bug with Ninja. At minimum, this canonicalization should be done when the path contains ".." components.
Can you think of a practical reason why this would cause issues?


https://reviews.llvm.org/D37954





More information about the cfe-commits mailing list