[ccache] ccache - .d files with absolute system header paths
anders at ecsit.se
Sat Sep 16 11:16:56 UTC 2017
Karanam Suryanarayana Rao Venkata Krishna wrote:
> I think I discovered a scenario that results in cache misses in spite of
> using CCACHE_BASEDIR.
> Consider the following command:
> CCACHE_BASEDIR=$PWD /bin/bash -c "ccache clang++
> -fdebug-prefix-map=/proc/self/cwd= -g -c -MD -MF hello.d -o hello.o
> It seems to me that is is perfectly alright to ask for debug prefix mapping
> like: "-fdebug-prefix-map=/proc/self/cwd="
> Unfortunately, ccache is ending up hashing gnu_getcwd(); thus, even though
> we use CCACHE_BASEDIR setting, such a cache cannot be shared by other
> users' from different workspaces resulting in cache misses.
> If the string after "=" in the mapping is null string, then, I hash "./".
Can't you just use "$PWD" and ".", instead of this elaborate scheme ?
Especially since using /proc/self/cwd doesn't even work, not with GCC...
i.e. when you give that prefix, it will just look for that path string
In the actual debug info, you will _still_ have a reference the cwd.
More information about the ccache