on POSIX systems, CIndexer::getClangResourcesPath() uses dladdr() to get the path of the shared object. It seems that on some systems (in our case, OS X 10.6.8), dladdr() does not return a canonicalized path. We're getting a path like PATH/TO/CLANG/build/bin/../lib/clang/4.0.0. This resource directory path is then used to calculate a hash used by CompilerInvocation::getModuleHash(). This, in turn, is causing Index/pch-from-libclang.c to fail for us because the module cache paths have different names -- the first path is calculated with PATH/TO/CLANG/build/lib/clang/4.0.0 and the second path uses PATH/TO/CLANG/build/bin/../lib/clang/4.0.0.
Fix this bug by returning a canonicalized path.