aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2026-08-10 09:17:30 +0200
committerTheo Buehler <tb@openbsd.org>2026-08-10 09:17:30 +0200
commit3999803a8f3d05d30e259dd5ae2dbda774bdcfcc (patch)
tree1a712684dc14392db0e845d7b83f3b7e9f1630ce
parent084dc32b373574ce9e83eeb0182060d84eb2e4c1 (diff)
parent201688e0e5297592281379a55568b16a13c0b8f0 (diff)
downloadportable-3999803a8f3d05d30e259dd5ae2dbda774bdcfcc.tar.gz
portable-3999803a8f3d05d30e259dd5ae2dbda774bdcfcc.tar.bz2
portable-3999803a8f3d05d30e259dd5ae2dbda774bdcfcc.zip
Land #1355 - run Windows ARM64 tests on native runners
-rw-r--r--.github/workflows/windows.yml26
-rw-r--r--patches/win32_arm64_bn_arch.h.patch21
2 files changed, 43 insertions, 4 deletions
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 4814ffa..27e6633 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -22,8 +22,15 @@ jobs:
22 fail-fast: false 22 fail-fast: false
23 matrix: 23 matrix:
24 os: ["windows-2022", "windows-2025"] 24 os: ["windows-2022", "windows-2025"]
25 arch: ["ARM64", "x64", "Win32"] 25 arch: ["x64", "Win32"]
26 shared: ["ON", "OFF"] 26 shared: ["ON", "OFF"]
27 include:
28 - os: "windows-11-arm"
29 arch: "ARM64"
30 shared: "ON"
31 - os: "windows-11-arm"
32 arch: "ARM64"
33 shared: "OFF"
27 steps: 34 steps:
28 - name: "Checkout repository" 35 - name: "Checkout repository"
29 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 36 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -53,12 +60,24 @@ jobs:
53 if ($LASTEXITCODE -ne 0) { 60 if ($LASTEXITCODE -ne 0) {
54 throw "IO::Socket::SSL::Utils is unavailable" 61 throw "IO::Socket::SSL::Utils is unavailable"
55 } 62 }
63
64 $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
65 $component = if ('${{ matrix.arch }}' -eq 'ARM64') {
66 'Microsoft.VisualStudio.Component.VC.Tools.ARM64'
67 } else {
68 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64'
69 }
70 $version = & $vswhere -latest -products * -requires $component -property installationVersion
71 if (-not $version) {
72 throw "No Visual Studio installation with $component found"
73 }
74 $major = $version.Split('.')[0]
56 $generator = cmake --help | 75 $generator = cmake --help |
57 Select-String '^\s*\*?\s*(Visual Studio \d+ \d+)' | 76 Select-String "^\s*\*?\s*(Visual Studio $major \d+)" |
58 Select-Object -First 1 | 77 Select-Object -First 1 |
59 ForEach-Object { $_.Matches[0].Groups[1].Value } 78 ForEach-Object { $_.Matches[0].Groups[1].Value }
60 if (-not $generator) { 79 if (-not $generator) {
61 throw "No Visual Studio CMake generator found" 80 throw "No CMake generator found for Visual Studio $major"
62 } 81 }
63 Write-Host "Using generator: $generator" 82 Write-Host "Using generator: $generator"
64 cmake -Bbuild -G "$generator" -A ${{ matrix.arch }} -D BUILD_SHARED_LIBS=${{ matrix.shared }} -D CMAKE_INSTALL_PREFIX=../local "-DPERL_EXECUTABLE=$perl" 83 cmake -Bbuild -G "$generator" -A ${{ matrix.arch }} -D BUILD_SHARED_LIBS=${{ matrix.shared }} -D CMAKE_INSTALL_PREFIX=../local "-DPERL_EXECUTABLE=$perl"
@@ -68,7 +87,6 @@ jobs:
68 run: cmake --build build --config Release 87 run: cmake --build build --config Release
69 88
70 - name: "Test" 89 - name: "Test"
71 if: matrix.arch != 'ARM64'
72 shell: cmd 90 shell: cmd
73 run: ctest --test-dir build -C Release --output-on-failure 91 run: ctest --test-dir build -C Release --output-on-failure
74 92
diff --git a/patches/win32_arm64_bn_arch.h.patch b/patches/win32_arm64_bn_arch.h.patch
new file mode 100644
index 0000000..427ed94
--- /dev/null
+++ b/patches/win32_arm64_bn_arch.h.patch
@@ -0,0 +1,21 @@
1--- crypto/bn/arch/aarch64/bn_arch.h.orig
2+++ crypto/bn/arch/aarch64/bn_arch.h
3@@ -20,4 +20,17 @@
4 #ifndef HEADER_BN_ARCH_H
5 #define HEADER_BN_ARCH_H
6-
7+#if defined(_MSC_VER) && defined(_M_ARM64)
8+
9+#include <intrin.h>
10+
11+#define HAVE_BN_CT_NE_ZERO
12+
13+static inline int
14+bn_ct_ne_zero(BN_ULONG w)
15+{
16+ return 1U ^ (_CountLeadingZeros64((unsigned __int64)w) >> 6);
17+}
18+
19+#endif
20+
21 #ifndef OPENSSL_NO_ASM