Skip to content

Commit 788a1c5

Browse files
mstorsjojeremyd2019
andcommitted
github: Run test-libcxx on ARM too
This requires setting CMAKE_CXX_COMPILER_TARGET manually; the LLVM build system infers the wrong architecture when CMake is an x86_64 binary. (The wrong inferred architecture doesn't affect building libcxx, but the wrong architecture gets passed as --target= parameter when running the tests.) Co-authored-by: Jeremy Drake <[email protected]>
1 parent 52dfc93 commit 788a1c5

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ jobs:
365365
./run-tests.sh /llvm-mingw
366366
./run-lldb-tests.sh /llvm-mingw
367367
368-
# Run libcxx's tests with the cross-built i686/x86_64 toolchains from above.
368+
# Run libcxx's tests with the cross-built toolchains from above.
369369
# (This builds its own copy of libcxx, but it should be pretty much
370370
# identical to the one shipped - and tests that the toolchain works
371371
# for running the libcxx tests.)
@@ -379,13 +379,15 @@ jobs:
379379
# temporarily on a branch for testing.
380380
if: false
381381
needs: [linux-cross-windows, prepare]
382-
runs-on: windows-latest
383382
strategy:
384383
fail-fast: false
385384
matrix:
386385
include:
387-
- { arch: x86_64, prefix: i686-w64-mingw32- }
388-
- { arch: x86_64, prefix: }
386+
- { arch: x86_64, target_arch: i686 }
387+
- { arch: x86_64, target_arch: x86_64 }
388+
- { arch: aarch64, target_arch: armv7 }
389+
- { arch: aarch64, target_arch: aarch64 }
390+
runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}}
389391
steps:
390392
- name: Install dependencies
391393
run: |
@@ -419,8 +421,9 @@ jobs:
419421
-DLIBCXX_ENABLE_WERROR=YES `
420422
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" `
421423
-DLIBCXX_CXX_ABI=libcxxabi `
422-
-DCMAKE_C_COMPILER=${{matrix.prefix}}clang `
423-
-DCMAKE_CXX_COMPILER=${{matrix.prefix}}clang++ `
424+
-DCMAKE_C_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang `
425+
-DCMAKE_CXX_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang++ `
426+
-DCMAKE_CXX_COMPILER_TARGET=${{matrix.target_arch}}-w64-windows-gnu `
424427
-DLIBCXXABI_ENABLE_SHARED=NO `
425428
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES `
426429
-DLIBCXX_USE_COMPILER_RT=YES `

.github/workflows/test-libcxx.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ jobs:
4141
4242
test-libcxx:
4343
needs: [prepare]
44-
runs-on: windows-latest
4544
strategy:
4645
fail-fast: false
4746
matrix:
4847
include:
49-
- { arch: x86_64, prefix: i686-w64-mingw32- }
50-
- { arch: x86_64, prefix: }
48+
- { arch: x86_64, target_arch: i686 }
49+
- { arch: x86_64, target_arch: x86_64 }
50+
- { arch: aarch64, target_arch: armv7 }
51+
- { arch: aarch64, target_arch: aarch64 }
52+
runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}}
5153
steps:
5254
- name: Install dependencies
5355
run: |
@@ -87,8 +89,9 @@ jobs:
8789
-DLIBCXX_ENABLE_WERROR=YES `
8890
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" `
8991
-DLIBCXX_CXX_ABI=libcxxabi `
90-
-DCMAKE_C_COMPILER=${{matrix.prefix}}clang `
91-
-DCMAKE_CXX_COMPILER=${{matrix.prefix}}clang++ `
92+
-DCMAKE_C_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang `
93+
-DCMAKE_CXX_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang++ `
94+
-DCMAKE_CXX_COMPILER_TARGET=${{matrix.target_arch}}-w64-windows-gnu `
9295
-DLIBCXXABI_ENABLE_SHARED=NO `
9396
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES `
9497
-DLIBCXX_USE_COMPILER_RT=YES `

0 commit comments

Comments
 (0)