Skip to content

Commit 01617b7

Browse files
committed
[libcxx] Run tests on Windows/arm64 too
This qualifies this configuration as a supported target platform. MinGW on aarch64 doesn't need defining __USE_MINGW_ANSI_STDIO=1 for having working printfs of long doubles, so skip it for this target, to get some more corner case test coverage.
1 parent 43797b4 commit 01617b7

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ jobs:
233233
**/crash_diagnostics/*
234234
235235
windows:
236-
runs-on: windows-2022
237236
strategy:
238237
fail-fast: false
239238
matrix:
@@ -243,6 +242,8 @@ jobs:
243242
- { config: mingw-static, mingw: true }
244243
- { config: mingw-dll-i686, mingw: true }
245244
- { config: mingw-incomplete-sysroot, mingw: true }
245+
- { config: mingw-static-aarch64, mingw: true, runner: windows-11-arm }
246+
runs-on: ${{ matrix.runner != '' && matrix.runner || 'windows-latest' }}
246247
steps:
247248
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
248249
- name: Install dependencies
@@ -256,7 +257,7 @@ jobs:
256257
- name: Install llvm-mingw
257258
if: ${{ matrix.mingw == true }}
258259
run: |
259-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-x86_64.zip
260+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-${{ matrix.runner == 'windows-11-arm' && 'aarch64' || 'x86_64' }}.zip
260261
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
261262
del llvm-mingw*.zip
262263
mv llvm-mingw* c:\llvm-mingw

libcxx/cmake/caches/MinGW.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
99

1010
# Without this flag, 'long double' (which is 80 bit on x86 mingw, but
1111
# 64 bit in MSVC) isn't handled correctly in printf.
12-
set(LIBCXX_EXTRA_SITE_DEFINES "__USE_MINGW_ANSI_STDIO=1" CACHE STRING "")
12+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "ARM.*" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
13+
# On aarch64, long doubles use the same ABI as in MSVC mode, so we don't need
14+
# to enable the MinGW specific stdio routines.
15+
else()
16+
set(LIBCXX_EXTRA_SITE_DEFINES "__USE_MINGW_ANSI_STDIO=1" CACHE STRING "")
17+
endif()

libcxx/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ macOS 10.13+ i386, x86_64, arm64
147147
FreeBSD 12+ i386, x86_64, arm
148148
Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported
149149
Android 5.0+ i386, x86_64, arm, arm64
150-
Windows i386, x86_64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable <DesignDocs/ABIVersioning>`
150+
Windows i386, x86_64, arm64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable <DesignDocs/ABIVersioning>`
151151
AIX 7.2TL5+ powerpc, powerpc64
152152
Embedded (picolibc) arm
153153
===================== ========================= ============================

libcxx/utils/ci/run-buildbot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ mingw-dll)
706706
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
707707
check-runtimes
708708
;;
709-
mingw-static)
709+
mingw-static|mingw-static-aarch64)
710710
clean
711711
generate-cmake \
712712
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \

0 commit comments

Comments
 (0)