Note that after applying both this patch and my previous patch, I can now compile and link an executable without first running vcvarsall, and the environment that it sets up is identical to that which would have been created by first running vcvarsall. http://reviews.llvm.org/D5873