Incorrect LD_LIBRARY_PATH manifests in a totally different way!

Hi

While building llvm trunk (including compiler-rt), the build (asan link) failed with "undefined reference to shm_open".

Upon search, it is found in librt.so. But -lrt was not there on the link-line at all. Adding -lrt in the CMake generated link.txt, makes the build go through. But thats not the solution.

Upon further searching, I find: