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.
This commit is contained in:
Martin Storsjö committed 2025-05-07 00:30:08 +03:00
1 parent 0a1f0030c1
commit 218ddb0bbd
1 file changed
+12 -3
+12 -3
View File
@@ -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 `