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

Mathias De Maré <[email protected]>
Newsgroups gmane.comp.compilers.ccache
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.