Despite a couple of targeted fixes that went through, there were still problems in some standalone build configurations. This turned out to be rather tricky, but can be explained simply:
Before: the check targets would run lit.py from the source tree
After: the check targets would run llvm-lit.py from the build tree
The interim fixes that were applied only made it try to run the llvm-lit.py from the *clang* build tree, which since this is a standalone environment is not going to be correct. We emit a bunch of source -> build tree mappings into the llvm-lit.py for example, and these would be all wrong if we use the wrong llvm-lit.py. Bottom line is that llvm-lit.py is tied to a particular build tree, and if you're going to run tests, it needs to be there.
The fix I've done here is to actually do that. We already have ${LLVM_MAIN_SRC_DIR} as a result of running llvm-config, so I can add an out-of-tree subdirectory to reach in and grab llvm/utils/llvm-lit. This causes it to run the lit configure step and generate llvm-lit.py into <compiler-rt-build-dir>/bin.
After this, everything works.
I'm submitting this as two separate patches. The first is the original patch which is broken. The second is the full diff including new changes to fix. This way you can diff v1 and v2 and see only the new stuff.