[ccache] Multiple targets with preprocessor mode and -g (was Re: Single 'source' collection, multiple targets)

Mathias De Maré mathias.de_mare at alcatel-lucent.com
Thu Apr 18 06:00:08 MDT 2013


On 04/18/2013 01:15 PM, Mathias De Maré wrote:
> Now, I actually have another issue which is partly related.
> It seems building for multiple targets with the preprocessor mode and 
> compiler option '-g' doesn't work for us.
> The preprocessed file contains the location where the build is executed.
> An example:
>> # 1 "src/foo.cpp"
>> # 1 "/home/mdemare/testdir/target2//" <--- this is an issue!
>> # 1 "<built-in>"
>> # 1 "<command-line>"
>> # 1 "src/foo.cpp"
>> int main() {
>>     return 0;
>> }
> If I build for one target in '/home/mdemare/testdir/target1' and for 
> another target in '/home/mdemare/testdir/target2', this results in a 
> cache miss.
> Using the direct mode (since there is no preprocessing), this issue 
> does not occur.
>
> I'm not 100% sure, but I think this is something that ccache should 
> change when using 'CCACHE_BASEDIR'.
Apparently, it's possible to use the gcc option 
'-fno-working-directory'. This gets rid of the issue for the example above.

Greetings,
Mathias


More information about the ccache mailing list