]> git.lizzy.rs Git - rust.git/commit
Fix cross-compilation of LLVM to aarch64 Windows targets
authorArlo Siemsen <arsiem@microsoft.com>
Thu, 2 Jul 2020 17:45:10 +0000 (10:45 -0700)
committerArlo Siemsen <arsiem@microsoft.com>
Wed, 8 Jul 2020 15:19:50 +0000 (08:19 -0700)
commit59f979fa06fed49e02606d4891b5b5e4fc545725
treec987bdb865adbf94ad8ad0adb1874578aca92b9b
parent1d919c9377f4602d991ca1c7ba852e7555943740
Fix cross-compilation of LLVM to aarch64 Windows targets

When cross-compiling, the LLVM build system recurses to build tools
that need to run on the host system. However, since we pass cmake defines
to set the compiler and target, LLVM still compiles these tools for the
target system, rather than the host. The tools then fail to execute
during the LLVM build.

This change sets defines for the tools that need to run on the
host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build
does not attempt to build them, and instead relies on the tools already built.

If compiling with clang-cl, this change also adds the `--target` option
to specify the target triple. MSVC compilers do not require this, since there
is a separate compiler binary for cross-compilation.
Cargo.lock
src/bootstrap/native.rs
src/llvm-project