You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pch1.pch is relocatable relative to current directory, i.e. it contains relative path pch.h. pch2.pch is not relocatable because ccache modified isysroot argument to . which Clang then failed to match header path against.
I am not 100% sure that this is ccache's fault instead of clang's. I think there might be situations where you may want PCH to be relocated against relative path, will clarify it with LLVM devs.
Expected behavior
Produced PCH files are binary identical (which they are if you do not pass CCACHE_BASEDIR).
Environment
ccache version 4.8
The text was updated successfully, but these errors were encountered:
LLVM confirmed that isysroot is not resolved in any way so ccache should not modify it when "relocatable-pch" is seen.
It seems that proper way would be to use relative isysroot in caching key though, so the same PCH will get a cache hit when compiled from different folder but changing isysroot will not result in false cache hit.
How to reproduce
touch pch.h
clang-16 -isysroot ${PWD} --relocatable-pch -x c++-header pch.h -o pch1.pch
CCACHE_BASEDIR=${PWD} ccache clang-16 -isysroot ${PWD} --relocatable-pch -x c++-header pch.h -o pch2.pch
Actual behavior
pch1.pch is relocatable relative to current directory, i.e. it contains relative path
pch.h
. pch2.pch is not relocatable because ccache modifiedisysroot
argument to.
which Clang then failed to match header path against.I am not 100% sure that this is ccache's fault instead of clang's. I think there might be situations where you may want PCH to be relocated against relative path, will clarify it with LLVM devs.
Expected behavior
Produced PCH files are binary identical (which they are if you do not pass CCACHE_BASEDIR).
Environment
ccache version 4.8
The text was updated successfully, but these errors were encountered: