microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.99k stars 6.34k forks source link

[llvm] build failure cross-compiling for windows-arm64 from windows-x64 #11973

Open shoaibkamil opened 4 years ago

shoaibkamil commented 4 years ago

I'm trying to cross-compile LLVM for Windows ARM64, using Visual Studio 2017, on a Windows x64 host machine.

Host Environment

To Reproduce Steps to reproduce the behavior:

>.\vcpkg.exe env --triplet arm64-windows
>.\vcpkg.exe install llvm --triplet arm64-windows

Failure logs

Computing installation plan...
The following packages will be built and installed:
    llvm[clang,core,disable-abi-breaking-checks,disable-assertions,disable-clang-static-analyzer,enable-rtti,lld,tools]:arm64-windows
Starting package 1/1: llvm:arm64-windows
Building package llvm[clang,core,disable-abi-breaking-checks,disable-assertions,disable-clang-static-analyzer,enable-rtti,lld,tools]:arm64-windows...
-- Note: llvm only supports static library linkage. Building static library.
-- Using cached D:/halide/vcpkg/downloads/llvm-llvm-project-llvmorg-10.0.0.tar.gz
-- Using source at D:/halide/vcpkg/buildtrees/llvm/src/org-10.0.0-32c002c70c
-- Configuring arm64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: ninja -v
    Working Directory: D:/halide/vcpkg/buildtrees/llvm/arm64-windows-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      D:\halide\vcpkg\buildtrees\llvm\config-arm64-windows-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:299 (vcpkg_execute_required_process)
  ports/llvm/portfile.cmake:170 (vcpkg_configure_cmake)
  scripts/ports.cmake:76 (include)

Error: Building package llvm:arm64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: llvm:arm64-windows
  Vcpkg version: 2020.02.04-nohash

config-arm64-windows-out.log

Additional context I tried commenting out the Python version check, but the build just fails later during configuration.

alexreinking commented 3 years ago

This probably has to do with needing to compile LLVM's tablegen tools in a separate folder for the host target first, before compiling all of LLVM for the intended target. I don't see anything in the LLVM portfile that would support this.