Skip to content

Commit 218ddb0

Browse files
committed
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.
1 parent 0a1f003 commit 218ddb0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/test-llvm.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ jobs:
4141
4242
test-llvm:
4343
needs: [prepare]
44-
runs-on: windows-latest
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
arch:
48+
- x86_64
49+
- aarch64
50+
runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}}
4551
steps:
4652
- name: Install dependencies
4753
run: |
@@ -54,7 +60,7 @@ jobs:
5460
commit: ${{inputs.commit}}
5561
branch: ${{inputs.branch}}
5662
event: ${{inputs.pipeline_type}}
57-
name: windows-ucrt-x86_64-toolchain
63+
name: windows-ucrt-${{matrix.arch}}-toolchain
5864
- name: Unpack toolchain
5965
run: |
6066
Expand-Archive llvm-mingw-*.zip -DestinationPath .
@@ -80,7 +86,10 @@ jobs:
8086
cmake ../llvm `
8187
-G Ninja `
8288
-DCMAKE_BUILD_TYPE=Release `
83-
-DLLVM_TARGETS_TO_BUILD=X86 `
89+
-DLLVM_HOST_TRIPLE=${{matrix.arch}}-w64-windows-gnu `
90+
-DCMAKE_SYSTEM_PROCESSOR=${{matrix.arch}} `
91+
-DCMAKE_SYSTEM_NAME=Windows `
92+
-DLLVM_TARGETS_TO_BUILD="AArch64;X86" `
8493
-DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" `
8594
-DLLVM_WINDOWS_PREFER_FORWARD_SLASH=OFF `
8695
-DCMAKE_C_COMPILER=clang `

0 commit comments

Comments
 (0)