I wasted some time setting a default target triple to 'arm-eabi', thinking it would be canonicalized. The build succeeded but testing blew up because utils/lit/lit/llvm/config.py has:
def make_itanium_abi_triple(self, triple): m = re.match(r'(\w+)-(\w+)-(\w+)', triple) ...
and that regex expects at least two '-'. Notice that regex isn't anchored and some triplets have '.' (solaris2.10 is the example I recall, dunno if anyone cares enough now though, it also doesn't affect the semantics of what's being checked there either.)
Anyway, this inserts a regex check in set_llvm_target_triplet to look for something at least reasonable at cmake config time -- somewhat earlier.
Includes a bit of line wrap reformatting while there.