[ccache] ccache - .d files with absolute system header paths

Karanam Suryanarayana Rao Venkata Krishna venkatakrishna.karanamsuryana at gmail.com
Wed Sep 20 08:38:16 UTC 2017


Hello,
Actually, the google aosp code has the schema I mentioned.
I just don't want to change it in our makefiles(nor can I influence the
upstream)
(they use clang)

As far as my patch, I used objdump to see that there are no absolute paths.

Thanks,
Venkat.

On Sat, Sep 16, 2017 at 1:16 PM, Anders Björklund via ccache <
ccache at lists.samba.org> wrote:

> Karanam Suryanarayana Rao Venkata Krishna wrote:
> > Hello,
> > 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
> > hello.cpp"
> >
> > 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.
>
> /Anders
> _______________________________________________
> ccache mailing list
> ccache at lists.samba.org
> https://lists.samba.org/mailman/listinfo/ccache
>


More information about the ccache mailing list