Skip to content

Commit cfc9ac8

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.) Only run check-cxx on ARM; there are a few unwinding tests (in check-cxxabi and check-unwind) that fail on ARM, relating to forced unwinding. Additionally, a couple tests need fixing in check-cxx; one category is fixed in the latest git main already (with backport request ongoing), and the other has been submitted as a fix PR recently. Co-authored-by: Jeremy Drake <[email protected]>
1 parent ae8e8f7 commit cfc9ac8

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ jobs:
366366
./run-tests.sh /llvm-mingw
367367
./run-lldb-tests.sh /llvm-mingw
368368
369-
# Run libcxx's tests with the cross-built i686/x86_64 toolchains from above.
369+
# Run libcxx's tests with the cross-built toolchains from above.
370370
# (This builds its own copy of libcxx, but it should be pretty much
371371
# identical to the one shipped - and tests that the toolchain works
372372
# for running the libcxx tests.)
@@ -380,13 +380,15 @@ jobs:
380380
# temporarily on a branch for testing.
381381
if: false
382382
needs: [linux-cross-windows, prepare]
383-
runs-on: windows-latest
384383
strategy:
385384
fail-fast: false
386385
matrix:
387386
include:
388-
- { arch: x86_64, prefix: i686-w64-mingw32- }
389-
- { arch: x86_64, prefix: }
387+
- { arch: x86_64, target_arch: i686 }
388+
- { arch: x86_64, target_arch: x86_64 }
389+
- { arch: aarch64, target_arch: armv7 }
390+
- { arch: aarch64, target_arch: aarch64 }
391+
runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}}
390392
steps:
391393
- name: Install dependencies
392394
run: |
@@ -420,8 +422,9 @@ jobs:
420422
-DLIBCXX_ENABLE_WERROR=YES `
421423
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" `
422424
-DLIBCXX_CXX_ABI=libcxxabi `
423-
-DCMAKE_C_COMPILER=${{matrix.prefix}}clang `
424-
-DCMAKE_CXX_COMPILER=${{matrix.prefix}}clang++ `
425+
-DCMAKE_C_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang `
426+
-DCMAKE_CXX_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang++ `
427+
-DCMAKE_CXX_COMPILER_TARGET=${{matrix.target_arch}}-w64-windows-gnu `
425428
-DLIBCXXABI_ENABLE_SHARED=NO `
426429
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES `
427430
-DLIBCXX_USE_COMPILER_RT=YES `
@@ -432,7 +435,7 @@ jobs:
432435
-DCMAKE_INSTALL_MESSAGE=NEVER `
433436
-DLLVM_LIT_ARGS="-v --time-tests"
434437
ninja
435-
ninja check-cxx check-cxxabi check-unwind
438+
ninja ${{startsWith(matrix.arch, 'a') && 'check-cxx' || 'check-cxx check-cxxabi check-unwind'}}
436439
437440
# Run the OpenMP tests with the cross-built toolchains from above.
438441
# This also forces testing the bundled python executables.

.github/workflows/test-libcxx.yml

Lines changed: 9 additions & 6 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 `
@@ -99,4 +102,4 @@ jobs:
99102
-DCMAKE_INSTALL_MESSAGE=NEVER `
100103
-DLLVM_LIT_ARGS="-v --time-tests"
101104
ninja
102-
ninja check-cxx check-cxxabi check-unwind
105+
ninja ${{startsWith(matrix.arch, 'a') && 'check-cxx' || 'check-cxx check-cxxabi check-unwind'}}

0 commit comments

Comments
 (0)