Add support for LTO and sanitizer variants to the driver and bootstrap script

This really needs to be checking the target triple. It seemed simple enough to do this properly and pull out the relevant bits of the triple, which I've done. (Note that this depends on the triple being LLVM-canonical, which is probably an invariant we can maintain.)