Fix cross-compiling problems in build-llvm.pl script. <rdar://problem/12986905>
Fix cross-compiling problems in build-llvm.pl script. <rdar://problem/12986905>

As with llvm svn r172138, this patch is basically copying some changes that
we've been using for building clang at Apple. Besides cleaning it up to use
xcrun to locate the proper versions of tools, especially for cross compiling,
it fixes the build to work with newer versions of clang that honor SDKROOT
settings in the environment.


git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@172324 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb