Skip to content

Commit ae75381

Browse files
Adds Windows ARM 64 Build script and related fixes (#18536)
Co-authored-by: Joseph Gershgorin <[email protected]>
1 parent 2a22e14 commit ae75381

4 files changed

Lines changed: 76 additions & 6 deletions

File tree

.github/workflows/MSYS2.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,21 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
sys: [MINGW64, UCRT64,CLANG64]
18-
runs-on: windows-latest
17+
include:
18+
# Existing x64 builds
19+
- sys: MINGW64
20+
runner: windows-latest
21+
- sys: UCRT64
22+
runner: windows-latest
23+
- sys: CLANG64
24+
runner: windows-latest
25+
26+
# New ARM64 build (native Windows on ARM)
27+
- sys: CLANGARM64
28+
runner: windows-11-arm
29+
30+
runs-on: ${{ matrix.runner }}
31+
1932
steps:
2033
- name: Checkout repository
2134
uses: actions/checkout@v4
@@ -25,7 +38,9 @@ jobs:
2538
with:
2639
msystem: ${{ matrix.sys }}
2740
update: true
28-
install: base-devel git
41+
install: >-
42+
base-devel
43+
git
2944
pacboy: >-
3045
gettext:p
3146
gobject-introspection:p
@@ -57,17 +72,18 @@ jobs:
5772
- name: Configure and build RetroArch
5873
shell: msys2 {0}
5974
run: |
60-
echo "Building RetroArch in ${{ matrix.sys }} environment"
75+
echo "Building RetroArch in ${{ matrix.sys }} on ${{ matrix.runner }}"
6176
./configure
62-
make -j$(nproc) info all
77+
make -j"$(nproc)" info all
6378
6479
- name: Collect DLLs and binaries
6580
shell: msys2 {0}
6681
run: |
6782
echo "Collecting DLLs and binaries"
83+
rm -rf dist
6884
mkdir -p dist
6985
cp retroarch.exe dist/
70-
ldd retroarch.exe|grep $MINGW_PREFIX |awk '{print $3}'|xargs -I {} cp {} dist/
86+
ldd retroarch.exe | grep "$MINGW_PREFIX" | awk '{print $3}' | xargs -I {} cp {} dist/ || true
7187
7288
- name: Archive build artifacts
7389
if: success()
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI Windows ARM64 (MSVC)
2+
3+
on:
4+
push:
5+
pull_request:
6+
repository_dispatch:
7+
types: [run_build]
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
14+
15+
jobs:
16+
msvc:
17+
runs-on: windows-11-arm
18+
strategy:
19+
matrix:
20+
version: [2022]
21+
configuration: [Debug, Release]
22+
platform: [ARM64]
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Add msbuild to PATH
28+
uses: microsoft/setup-msbuild@v1
29+
30+
- name: Compile RA
31+
working-directory: "${{ github.workspace }}/pkg/msvc"
32+
run: |
33+
msbuild -p:"Configuration=${{ matrix.configuration }}" -p:"Platform=${{ matrix.platform }}" .\RetroArch-msvc${{ matrix.version }}.sln
34+
35+
- name: Get short SHA
36+
id: slug
37+
shell: powershell
38+
run: echo "sha8=$('${{ github.sha }}'.Substring(0,8))" >> $env:GITHUB_OUTPUT
39+
40+
- uses: actions/upload-artifact@v4
41+
with:
42+
name: retroarch-${{ matrix.version }}-${{ matrix.configuration }}-${{ matrix.platform }}-${{ steps.slug.outputs.sha8 }}
43+
path: |
44+
pkg/msvc/${{ matrix.platform }}/${{ matrix.configuration }}/RetroArch-msvc${{ matrix.version }}.exe

config.def.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,6 +1847,9 @@
18471847
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86_64/latest/"
18481848
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
18491849
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86/latest/"
1850+
#elif defined(__aarch64__) || defined(_M_ARM64)
1851+
/* No official MinGW/clang ARM64 buildbot yet – use empty default */
1852+
#define DEFAULT_BUILDBOT_SERVER_URL ""
18501853
#endif
18511854
#endif
18521855
#elif defined(__linux__)

deps/mbedtls/timing.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
#include <windows.h>
4444
#include <winbase.h>
4545

46+
#if defined(__MINGW32__) || defined(__MINGW64__)
47+
/* MSYS2/MinGW: provide struct timeval + gettimeofday() for the
48+
* fallback timing implementation used when HAVE_HARDCLOCK
49+
* isn't defined (e.g., on aarch64-w64-mingw32 / clangarm64). */
50+
#include <sys/time.h>
51+
#endif
52+
4653
struct _hr_time
4754
{
4855
LARGE_INTEGER start;

0 commit comments

Comments
 (0)