From 218ddb0bbd4dd16237b9489f72dffc3529def788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 6 May 2025 11:29:18 +0300 Subject: [PATCH] github: Run test-llvm on aarch64 too As the preinstalled CMake on the windows-11-arm runners currently is an x86_64 build, we need to explicitly specify CMAKE_SYSTEM_PROCESSOR, and CMAKE_SYSTEM_NAME to make CMake consider it a cross compilation (otherwise CMAKE_SYSTEM_PROCESSOR gets overridden by CMAKE_HOST_SYSTEM_PROCESSOR, which gets influenced by the x86_64 as CMake is running emulated). We also need to set LLVM_HOST_TRIPLE, as the autodetection of it relies on CMAKE_HOST_SYSTEM_PROCESSOR. The host triple needs to be in normalized form with "-windows-gnu", otherwise a couple dozens of tests fail. We also include the AArch64 target, to make sure the built compiler can generate code for the host. Since 07bc54bf4554398b199f4dc849e5193b98422f23 in llvm-project (May 5th), these tests should pass on aarch64 too. --- .github/workflows/test-llvm.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-llvm.yml b/.github/workflows/test-llvm.yml index 9633a5e..d9a0d5c 100644 --- a/.github/workflows/test-llvm.yml +++ b/.github/workflows/test-llvm.yml @@ -41,7 +41,13 @@ jobs: test-llvm: needs: [prepare] - runs-on: windows-latest + strategy: + fail-fast: false + matrix: + arch: + - x86_64 + - aarch64 + runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}} steps: - name: Install dependencies run: | @@ -54,7 +60,7 @@ jobs: commit: ${{inputs.commit}} branch: ${{inputs.branch}} event: ${{inputs.pipeline_type}} - name: windows-ucrt-x86_64-toolchain + name: windows-ucrt-${{matrix.arch}}-toolchain - name: Unpack toolchain run: | Expand-Archive llvm-mingw-*.zip -DestinationPath . @@ -80,7 +86,10 @@ jobs: cmake ../llvm ` -G Ninja ` -DCMAKE_BUILD_TYPE=Release ` - -DLLVM_TARGETS_TO_BUILD=X86 ` + -DLLVM_HOST_TRIPLE=${{matrix.arch}}-w64-windows-gnu ` + -DCMAKE_SYSTEM_PROCESSOR=${{matrix.arch}} ` + -DCMAKE_SYSTEM_NAME=Windows ` + -DLLVM_TARGETS_TO_BUILD="AArch64;X86" ` -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" ` -DLLVM_WINDOWS_PREFER_FORWARD_SLASH=OFF ` -DCMAKE_C_COMPILER=clang `