base_dir and -Xclang option - bug or incompleteness?

Michael Kolomeytsev <[email protected]> Wed, 23 Mar 2016 22:56:16 +0600
Newsgroups gmane.comp.compilers.ccache
Message-ID <CA+-eyyrHObWBdnWnj4F6M6i-qB3kn8TJo=G1bPHbSnwRN0eHvw@mail.gmail.com>
Hi,
I have two copies of the same project and use base_dir option to share
cache between them.
And everything works fine until there are such options in command line:
... -Xclang -load -Xclang /project1/path/libFindBadConstructs.so ...
The path to the libFindBadConstructs.so is slightly different:
/project1/path/libFindBadConstructs.so or
/project2/path/libFindBadConstructs.so.
And currently ccache generates two different hashes/manifests and there is
no cache sharing unfortunately :(

I looked into the ccache source code.
https://github.com/jrosdahl/ccache/blob/master/ccache.c#L1696 - that
special Xlang options  processing is exactly what I need. But it doesn't
work 'cause "i+=3" is forgotten before the "continue"?

Or should we add hashes for that options but "make_relative_path" for a
path to a plugin?
It seems replacing TAKE_ARG with TAKE_PATH in compopt.c for "Xclang" is
enough.
https://github.com/jrosdahl/ccache/blob/master/compopt.c#L53

I can fix it if someone will say what fix is better.