From d1ca6b578a995bcac3597c8bc166ae6cbd5c0055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 19 Apr 2025 23:25:25 +0300 Subject: [PATCH] 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.) Since 9c67ae861ccb0312fc680414a8441892d169d14a in llvm-project (May 9th), these tests should pass on aarch64 too. Co-authored-by: Jeremy Drake --- .github/workflows/build.yml | 15 +++++++++------ .github/workflows/test-libcxx.yml | 13 ++++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 273a161..969cb04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -365,7 +365,7 @@ jobs: ./run-tests.sh /llvm-mingw ./run-lldb-tests.sh /llvm-mingw - # Run libcxx's tests with the cross-built i686/x86_64 toolchains from above. + # Run libcxx's tests with the cross-built toolchains from above. # (This builds its own copy of libcxx, but it should be pretty much # identical to the one shipped - and tests that the toolchain works # for running the libcxx tests.) @@ -379,13 +379,15 @@ jobs: # temporarily on a branch for testing. if: false needs: [linux-cross-windows, prepare] - runs-on: windows-latest strategy: fail-fast: false matrix: include: - - { arch: x86_64, prefix: i686-w64-mingw32- } - - { arch: x86_64, prefix: } + - { arch: x86_64, target_arch: i686 } + - { arch: x86_64, target_arch: x86_64 } + - { arch: aarch64, target_arch: armv7 } + - { arch: aarch64, target_arch: aarch64 } + runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}} steps: - name: Install dependencies run: | @@ -419,8 +421,9 @@ jobs: -DLIBCXX_ENABLE_WERROR=YES ` -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" ` -DLIBCXX_CXX_ABI=libcxxabi ` - -DCMAKE_C_COMPILER=${{matrix.prefix}}clang ` - -DCMAKE_CXX_COMPILER=${{matrix.prefix}}clang++ ` + -DCMAKE_C_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang ` + -DCMAKE_CXX_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang++ ` + -DCMAKE_CXX_COMPILER_TARGET=${{matrix.target_arch}}-w64-windows-gnu ` -DLIBCXXABI_ENABLE_SHARED=NO ` -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES ` -DLIBCXX_USE_COMPILER_RT=YES ` diff --git a/.github/workflows/test-libcxx.yml b/.github/workflows/test-libcxx.yml index b034cc1..3e5a438 100644 --- a/.github/workflows/test-libcxx.yml +++ b/.github/workflows/test-libcxx.yml @@ -41,13 +41,15 @@ jobs: test-libcxx: needs: [prepare] - runs-on: windows-latest strategy: fail-fast: false matrix: include: - - { arch: x86_64, prefix: i686-w64-mingw32- } - - { arch: x86_64, prefix: } + - { arch: x86_64, target_arch: i686 } + - { arch: x86_64, target_arch: x86_64 } + - { arch: aarch64, target_arch: armv7 } + - { arch: aarch64, target_arch: aarch64 } + runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}} steps: - name: Install dependencies run: | @@ -87,8 +89,9 @@ jobs: -DLIBCXX_ENABLE_WERROR=YES ` -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" ` -DLIBCXX_CXX_ABI=libcxxabi ` - -DCMAKE_C_COMPILER=${{matrix.prefix}}clang ` - -DCMAKE_CXX_COMPILER=${{matrix.prefix}}clang++ ` + -DCMAKE_C_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang ` + -DCMAKE_CXX_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang++ ` + -DCMAKE_CXX_COMPILER_TARGET=${{matrix.target_arch}}-w64-windows-gnu ` -DLIBCXXABI_ENABLE_SHARED=NO ` -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES ` -DLIBCXX_USE_COMPILER_RT=YES `