Currently Online

Latest Posts

Topic: Speedup rebuilds

ixprefect

Joined: 2009-02-27, 13:28
Posts: 367
Ranking
Tribe Member
Posted at: 2013-03-17, 13:10

borim wrote: You can also use the symbolic links provided by ccache /usr/lib/ccache

You'd think so, but have you actually tried it?

It didn't work for me, and that's actually quite plausible. The problem is that all the links in /usr/lib/ccache simply point to the ccache executable. So if you link /usr/bin/c++ to /usr/lib/ccache/c++ or even /usr/lib/ccache/g++, then ccache is run. How does ccache know which compiler to invoke? Well, it looks at its command line, whose argv[0] still is c++, despite the symbolic link magic. But calling c++ just loops back to running ccache, which is no good. This cycle needs to be broken, and having those explicit scripts in there does the job.


Top Quote
borim

Topic Opener
Joined: 2009-09-04, 11:13
Posts: 52
Ranking
Likes to be here
Location: germany
Posted at: 2013-03-17, 14:34

I did not test it with the alternative mechanism, just with tweaking the PATH variable. And at least this way it works fine.

I can only guess what the reason is, but maybe when running ccache. The PATH is scanned for the second match and this is used as compiler.


Top Quote