github actions: moving arm64 from msvc to clang (#2825)

This commit is contained in:
barbudreadmon authored and GitHub committed 2026-10-22 10:17:32 +02:00
1 parent d426431036
commit cb74082bac
6 files changed
+85 -68

No files matched your search

+28 -56
View File
@@ -264,50 +264,36 @@ jobs:
build_windows_arm64:
name: Build (Windows ARM64)
runs-on: windows-11-vs2026-arm
runs-on: windows-11-arm
continue-on-error: true
defaults:
run:
shell: msys2 {0}
steps:
- name: Install dependencies
uses: msys2/setup-msys2@v2
with:
update: true
install: msys2-devel base-devel mingw-w64-clang-aarch64-toolchain zip wget perl
msystem: CLANGARM64
- name: Clone
uses: actions/checkout@v4
- name: Build
id: create_windows_arm64_exe
shell: cmd
run: |
for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -version [18.0^,19.0^) -requires Microsoft.VisualStudio.Component.VC.Tools.ARM64 -property installationPath`) do set "VCINSTALLDIR=%%i"
if not defined VCINSTALLDIR exit /b 1
call "%VCINSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
msbuild projectfiles\visualstudio-2026\fbneo_vs2026.sln /m /property:Configuration=Release /property:Platform=ARM64 /verbosity:minimal
set "PROJECT=projectfiles\visualstudio-2026"
for %%F in (ctv_make.exe pgm_sprite_create.exe m68kmake.exe build_details_arm64.exe) do dumpbin /headers "%PROJECT%\hosttools\x64\Release\%%F" | findstr /C:"machine (ARM64)" /C:"machine (AA64)" /C:"machine (x64)" >nul || exit /b 1
dumpbin /headers "%PROJECT%\ARM64\Release\fbneoarm64.exe" | findstr /C:"machine (ARM64)" /C:"machine (AA64)" >nul || exit /b 1
findstr /C:"#define BUILD_CPU ARM64" "%PROJECT%\generated\build_details.h" >nul || exit /b 1
dir /s /b "%PROJECT%\ARM64\Release\obj\*.asm.obj" >nul 2>&1 && exit /b 1 || ver >nul
- name: Package
id: create_windows_arm64_archive
shell: pwsh
run: |
$archive = '${{ env.WINDOWS_ARM64_ARTIFACT }}.zip'
Compress-Archive -DestinationPath $archive -Force -Path `
projectfiles/visualstudio-2026/ARM64/Release/fbneoarm64.exe, `
src/license.txt, `
fbahelpfilesrc/fbneo.chm, `
whatsnew.html
"archive_file=$archive" >> $env:GITHUB_OUTPUT
make -j$(nproc) mingwarm64 SKIPDEPEND=1 RELEASEBUILD=1
archive_file="${{ env.WINDOWS_ARM64_ARTIFACT }}.zip"
echo "archive_file=${archive_file}" >> $GITHUB_OUTPUT
zip --junk-paths "${archive_file}" fbneoarm64.exe src/license.txt fbahelpfilesrc/fbneo.chm whatsnew.html
- name: Create Archive Path
shell: bash
run: |
echo archive_path= '${{ steps.create_windows_arm64_archive.outputs.archive_file }}' > $WINDOWS_ARM64_ARTIFACT_PATH
- name: Upload Archive Path
uses: actions/upload-artifact@v4
with:
name: ${{ env.WINDOWS_ARM64_ARTIFACT }}
path: ${{ env.WINDOWS_ARM64_ARTIFACT_PATH }}
retention-days: 1
- name: Upload Archive as Artifact
uses: actions/upload-artifact@v4
with:
@@ -317,50 +303,36 @@ jobs:
build_windows_arm64_debug:
name: Build (Windows ARM64 Debug)
runs-on: windows-11-vs2026-arm
runs-on: windows-11-arm
continue-on-error: true
defaults:
run:
shell: msys2 {0}
steps:
- name: Install dependencies
uses: msys2/setup-msys2@v2
with:
update: true
install: msys2-devel base-devel mingw-w64-clang-aarch64-toolchain zip wget perl
msystem: CLANGARM64
- name: Clone
uses: actions/checkout@v4
- name: Build
id: create_windows_arm64_debug_exe
shell: cmd
run: |
for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -version [18.0^,19.0^) -requires Microsoft.VisualStudio.Component.VC.Tools.ARM64 -property installationPath`) do set "VCINSTALLDIR=%%i"
if not defined VCINSTALLDIR exit /b 1
call "%VCINSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
msbuild projectfiles\visualstudio-2026\fbneo_vs2026.sln /m /property:Configuration=Debug /property:Platform=ARM64 /verbosity:minimal
set "PROJECT=projectfiles\visualstudio-2026"
for %%F in (ctv_make.exe pgm_sprite_create.exe m68kmake.exe build_details_arm64.exe) do dumpbin /headers "%PROJECT%\hosttools\x64\Release\%%F" | findstr /C:"machine (ARM64)" /C:"machine (AA64)" /C:"machine (x64)" >nul || exit /b 1
dumpbin /headers "%PROJECT%\ARM64\Debug\fbneoarm64d.exe" | findstr /C:"machine (ARM64)" /C:"machine (AA64)" >nul || exit /b 1
findstr /C:"#define BUILD_CPU ARM64" "%PROJECT%\generated\build_details.h" >nul || exit /b 1
dir /s /b "%PROJECT%\ARM64\Debug\obj\*.asm.obj" >nul 2>&1 && exit /b 1 || ver >nul
- name: Package
id: create_windows_arm64_debug_archive
shell: pwsh
run: |
$archive = '${{ env.WINDOWS_ARM64_DEBUG_ARTIFACT }}.zip'
Compress-Archive -DestinationPath $archive -Force -Path `
projectfiles/visualstudio-2026/ARM64/Debug/fbneoarm64d.exe, `
src/license.txt, `
fbahelpfilesrc/fbneo.chm, `
whatsnew.html
"archive_file=$archive" >> $env:GITHUB_OUTPUT
make -j$(nproc) mingwarm64 SKIPDEPEND=1
archive_file="${{ env.WINDOWS_ARM64_DEBUG_ARTIFACT }}.zip"
echo "archive_file=${archive_file}" >> $GITHUB_OUTPUT
zip --junk-paths "${archive_file}" fbneoarm64d.exe src/license.txt fbahelpfilesrc/fbneo.chm whatsnew.html
- name: Create Archive Path
shell: bash
run: |
echo archive_path= '${{ steps.create_windows_arm64_debug_archive.outputs.archive_file }}' > $WINDOWS_ARM64_DEBUG_ARTIFACT_PATH
- name: Upload Archive Path
uses: actions/upload-artifact@v4
with:
name: ${{ env.WINDOWS_ARM64_DEBUG_ARTIFACT }}
path: ${{ env.WINDOWS_ARM64_DEBUG_ARTIFACT_PATH }}
retention-days: 1
- name: Upload Archive as Artifact
uses: actions/upload-artifact@v4
with:
+8
View File
@@ -102,6 +102,14 @@ mingwcc: FORCE
mingwcc64: FORCE
@$(MAKE) -s -f makefile.mingw BUILD_X64_EXE=1 GCC510=1 BORKYCRT=1 HOST_CC=gcc HOST_CXX=g++ CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ WINDRES=x86_64-w64-mingw32-windres
# Native Windows ARM64 build with MSYS2 (CLANGARM64 environment)
mingwarm64: FORCE
@$(MAKE) -s -f makefile.mingw BUILD_ARM64_EXE=1 GCC510=1 BORKYCRT=1
# Cross compile a windows ARM64 binary from linux (llvm-mingw)
mingwccarm64: FORCE
@$(MAKE) -s -f makefile.mingw BUILD_ARM64_EXE=1 GCC510=1 BORKYCRT=1 HOST_CC=gcc HOST_CXX=g++ CC=aarch64-w64-mingw32-clang CXX=aarch64-w64-mingw32-clang++ WINDRES=aarch64-w64-mingw32-windres
mamemingw: FORCE
@$(MAKE) -s -f makefile.mamemingw
+41 -9
View File
@@ -26,7 +26,7 @@ WINDRES=windres
NAME = fbneo
COMPILENAME = 3
ifdef BUILD_X64_EXE
ifneq ($(BUILD_X64_EXE)$(BUILD_ARM64_EXE),)
ifdef BUILD_A68K
undefine BUILD_A68K
endif
@@ -57,6 +57,10 @@ ifdef BUILD_X64_EXE
NAME = fbneo64
COMPILENAME = 6
endif
ifdef BUILD_ARM64_EXE
NAME = fbneoarm64
COMPILENAME = a64
endif
ifdef DEBUG
NAME := $(NAME)d
COMPILENAME := $(COMPILENAME)d
@@ -183,8 +187,15 @@ autdrv := $(drvsrc:.cpp=.o)
#
#
ifdef BUILD_ARM64_EXE
# MSYS2 only provides clang for aarch64 (CLANGARM64 environment)
CC = clang
CXX = clang++
WINDRES = llvm-windres
else
CC = gcc
CXX = g++
endif
LD = $(CXX)
AS = nasm
@@ -264,20 +275,23 @@ endif
endif
ifdef GCC510
ifdef BUILD_ARM64_EXE
GCCOPTFLAGS =
else
GCCOPTFLAGS = -ffloat-store -fforce-addr -finline-limit=1200 -fthread-jumps -fexpensive-optimizations
endif
CFLAGS = -pipe \
-std=gnu99 -O3 -ffloat-store \
-std=gnu99 -O3 $(GCCOPTFLAGS) \
-mwindows \
-fforce-addr -finline-limit=1200 -fthread-jumps \
-fexpensive-optimizations \
-Wall -Wno-long-long -Wno-sign-compare -Wno-uninitialized -Wno-unused \
-Wno-sequence-point -Wno-pedantic \
$(DEF) $(incdir)
CXXFLAGS = -pipe \
-std=gnu++11 -O3 -ffloat-store \
-std=gnu++11 -O3 $(GCCOPTFLAGS) \
-mwindows \
-fforce-addr -finline-limit=1200 -fthread-jumps \
-fexpensive-optimizations -fcheck-new \
-fcheck-new \
-Wall -W -pedantic -Wshadow -Wno-long-long -Wno-write-strings \
-Wunknown-pragmas -Wundef -Wno-conversion -Wno-missing-braces -Wno-multichar \
-Wuninitialized -Wpointer-arith -Wno-inline -Wno-address -Wno-unused-value \
@@ -290,7 +304,10 @@ ifdef BORKYCRT
CFLAGS += -D__USE_MINGW_ANSI_STDIO=0
CXXFLAGS += -D__USE_MINGW_ANSI_STDIO=0
endif
ifdef BUILD_X64_EXE
ifdef BUILD_ARM64_EXE
# allow nasty C code in i8051.cpp
CXXFLAGS += -fpermissive
else ifdef BUILD_X64_EXE
CFLAGS += -m64
CXXFLAGS += -m64
LDFLAGS += -m64
@@ -490,6 +507,17 @@ endif
ifeq ($(MAKELEVEL),2)
ifdef BUILD_ARM64_EXE
# lld can't do partial links (-r) on COFF, pass every object through a response file instead
$(NAME).exe: $(allobj) $(autdrv) $(depobj)
@echo
@echo Linking executable... $(NAME).exe
$(file >$(objdir)link.rsp,$^)
@$(LD) $(CFLAGS) $(LDFLAGS) -o $@ @$(objdir)link.rsp $(lib)
else
$(objdir)/drivers.o: $(autdrv)
@echo Linking drivers...
ifdef BUILD_X64_EXE
@@ -503,6 +531,8 @@ $(NAME).exe: $(allobj) $(objdir)/drivers.o $(depobj)
@echo Linking executable... $(NAME).exe
@$(LD) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(lib)
endif
ifdef DEBUG
# Don't compress when making a debug build
@@ -729,7 +759,9 @@ else
endif
endif
ifdef GCC510
ifdef BUILD_X64_EXE
ifdef BUILD_ARM64_EXE
@$(WINDRES) $(DEF) $< -o $(subst $(srcdir),$(objdir),$(<D))/$(@F) $(foreach dir,$(alldir),--include-dir $(srcdir)$(dir))
else ifdef BUILD_X64_EXE
@$(WINDRES) -F pe-x86-64 $(DEF) $< -o $(subst $(srcdir),$(objdir),$(<D))/$(@F) $(foreach dir,$(alldir),--include-dir $(srcdir)$(dir))
else
@$(WINDRES) -F pe-i386 $(DEF) $< -o $(subst $(srcdir),$(objdir),$(<D))/$(@F) $(foreach dir,$(alldir),--include-dir $(srcdir)$(dir))
@@ -30,7 +30,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>FBNEO_TARGET_ARM64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BUILD_ARM64_EXE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
+4 -2
View File
@@ -11,7 +11,7 @@ int main(int /*argc*/, char** /*argv*/)
printf("#define BUILD_CHAR ANSI\n");
#endif
#if defined FBNEO_TARGET_ARM64
#if defined BUILD_ARM64_EXE
printf("#define BUILD_CPU ARM64\n");
#elif defined BUILD_X64_EXE
printf("#define BUILD_CPU X64\n");
@@ -19,7 +19,9 @@ int main(int /*argc*/, char** /*argv*/)
printf("#define BUILD_CPU X86\n");
#endif
#if defined __GNUC__
#if defined __clang__
printf("#define BUILD_COMP Clang %i.%i.%i\n", __clang_major__, __clang_minor__, __clang_patchlevel__);
#elif defined __GNUC__
printf("#define BUILD_COMP GCC %i.%i.%i\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#elif defined _MSC_VER
#if _MSC_VER >= 1300 && _MSC_VER < 1310
+3
View File
@@ -79,6 +79,9 @@ while ( my $line = <INFILE> ) {
# add NOT WS_POPUP to all windows with WS_CHILD specified
$line =~ s/(?<!NOT\s)(WS_CHILD)/$1 \| NOT WS_POPUP/;
# llvm-rc doesn't support multiplication, precompute constant products (outside of strings)
$line = join '', map { /^"/ ? $_ : do { my $s = $_; 1 while $s =~ s/(\d+)\s*\*\s*(\d+)/$1 * $2/e; $s } } split /("(?:[^"]|"")*")/, $line;
# Fix FONT statements (remove rubbish after font name)
if ( $line =~ /(^FONT\s+\w+,\s*".*")/ ) {
$line = $1;