Skip to content

Commit e8f20df

Browse files
authored
Merge pull request #8546 from FirebirdSQL/work/windows-arm-build
Windows ARM64 support
2 parents 50cdb11 + 9ea4fa4 commit e8f20df

File tree

90 files changed

+6048
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+6048
-71
lines changed

.github/workflows/main.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,72 @@ jobs:
211211
name: firebird-windows-vs-${{ env.VS_VERSION }}-${{ matrix.platform }}-installer
212212
path: builds/install_images/*-windows-${{ matrix.platform }}.exe
213213

214+
# Windows ARM container is not yet available, so official build is done directly in Windows 11 runner
215+
build-windows-arm64:
216+
#if: github.ref_type != 'tag'
217+
runs-on: windows-11-arm
218+
env:
219+
VS_VERSION: 2022
220+
221+
steps:
222+
- name: Checkout
223+
uses: actions/checkout@v4
224+
with:
225+
fetch-depth: 10
226+
227+
- name: Adjust snapshot build number
228+
uses: ./.github/actions/adjust-snapshot-buildno
229+
230+
- name: Prepare
231+
shell: cmd
232+
run: |
233+
for /r %%i in (*.bat) do unix2dos "%%i"
234+
REM choco uninstall --no-progress --yes innosetup
235+
choco install --no-progress --yes innosetup --version=6.4.0
236+
237+
- name: Build
238+
shell: cmd
239+
env:
240+
VS_SCRIPT: C:\Program Files\Microsoft Visual Studio\%VS_VERSION%\Enterprise\Common7\Tools\VsDevCmd.bat
241+
run: |
242+
set SEVENZIP=C:\Program Files\7-Zip
243+
set INNO6_SETUP_PATH=C:\Program Files (x86)\Inno Setup 6
244+
set FB_VS_ARCH=arm64
245+
set FB_PROCESSOR_ARCHITECTURE=ARM64
246+
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
247+
cd builds\win32
248+
call run_all.bat PDB
249+
call run_tests.bat
250+
251+
- name: Upload zip
252+
uses: actions/upload-artifact@v4
253+
with:
254+
name: firebird-windows-vs-${{ env.VS_VERSION }}-arm64-zip
255+
path: builds/install_images/Firebird-*-windows-arm64.zip
256+
257+
- name: Upload installer
258+
uses: actions/upload-artifact@v4
259+
with:
260+
name: firebird-windows-vs-${{ env.VS_VERSION }}-arm64-installer
261+
path: builds/install_images/*-windows-arm64.exe
262+
263+
- name: Upload installer (withDebugSymbols)
264+
uses: actions/upload-artifact@v4
265+
with:
266+
name: firebird-windows-arm64-withDebugSymbols-installer
267+
path: builds/install_images/*-windows-arm64-withDebugSymbols.exe
268+
269+
- name: Create release
270+
uses: ./.github/actions/create-release
271+
with:
272+
token: ${{ secrets.SNAPSHOT_RELEASE_TOKEN }}
273+
deletePatterns: |
274+
Firebird-*-windows-arm64*.exe
275+
Firebird-*-windows-arm64*.zip
276+
uploadFiles: |
277+
builds/install_images/Firebird-*-windows-arm64*.exe
278+
builds/install_images/Firebird-*-windows-arm64*.zip
279+
214280
build-windows-docker:
215281
runs-on: windows-2022
216282

builds/install/arch-specific/win32/BuildExecutableInstall.bat

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
176176
@if "%FB_TARGET_PLATFORM%"=="x64" (
177177
set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-x64
178178
) else (
179-
set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-x86
179+
@if "%FB_TARGET_PLATFORM%"=="arm64" (
180+
set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-arm64
181+
) else (
182+
set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-x86
183+
)
180184
)
181185

182186
@setlocal
@@ -489,7 +493,11 @@ for %%v in (IPLicense.txt IDPLicense.txt ) do (
489493
::
490494
::=================================================
491495
@echo.
492-
@call %ISCC_COMMAND% %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall.iss
496+
if "%FB_TARGET_PLATFORM%"=="arm64" (
497+
@call %ISCC_COMMAND% /DPlatformTarget=arm64 %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall.iss
498+
) else (
499+
@call %ISCC_COMMAND% %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall.iss
500+
)
493501
@echo.
494502

495503
::End of ISX_PACK

builds/install/arch-specific/win32/FirebirdInstall.iss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,18 @@
212212
;Assume native platform
213213
#if IsWin64
214214
#define PlatformTarget "x64"
215+
;---- IsArm64 is not available in preprocessor, so /DPlatformTarget=arm64 should be passed in the command line
216+
;#elif IsArm64
217+
;#define PlatformTarget "arm64"
215218
#else
216219
#define PlatformTarget "win32"
217220
#endif
218221
#endif
219222

220223
#if PlatformTarget == "x64"
221224
#define ReleasePlatformTarget "x64"
225+
#elif PlatformTarget == "arm64"
226+
#define ReleasePlatformTarget "arm64"
222227
#else
223228
#define ReleasePlatformTarget "x86"
224229
#endif
@@ -327,6 +332,8 @@ SetupMutex={#MyAppName}
327332
#if PlatformTarget == "x64"
328333
ArchitecturesAllowed=x64
329334
ArchitecturesInstallIn64BitMode=x64
335+
#elif PlatformTarget == "arm64"
336+
ArchitecturesAllowed=arm64
330337
#endif
331338

332339
;This feature is incomplete, as more thought is required.
@@ -398,9 +405,12 @@ Name: CopyFbClientAsGds32Task; Description: {cm:CopyFbClientAsGds32Task}; Compon
398405
[Run]
399406
; due to the changes required to support MSVC15 support for earlier versions is now broken.
400407
#if Int(msvc_runtime_major_version,14) >= 14
408+
#if PlatformTarget != "arm64"
401409
Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_Win32.msi"" /L*v ""{tmp}\vccrt{#msvc_runtime_library_version}_Win32.log"" "; StatusMsg: "Installing MSVC 32-bit runtime libraries to system directory"; Check: HasWI30; Components: ClientComponent;
402-
#if PlatformTarget == "x64"
410+
#elif PlatformTarget == "x64"
403411
Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_x64.msi"" /L*v ""{tmp}\vccrt{#msvc_runtime_library_version}_x64.log"" "; StatusMsg: "Installing MSVC 64-bit runtime libraries to system directory"; Check: HasWI30; Components: ClientComponent;
412+
#elif PlatformTarget == "arm64"
413+
; Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_arm64.msi"" /L*v ""{tmp}\vccrt{#msvc_runtime_library_version}_arm64.log"" "; StatusMsg: "Installing MSVC ARM64 runtime libraries to system directory"; Check: HasWI30; Components: ClientComponent;
404414
#endif
405415
#endif
406416

@@ -547,8 +557,10 @@ Source: {#WOW64Dir}\msvcp{#msvc_runtime_file_version}.dll; DestDir: {app}\WOW64;
547557
;In addition, O/S must have Windows Installer 3.0.
548558
Source: {#FilesDir}\system32\vccrt{#msvc_runtime_library_version}_x64.msi; DestDir: {tmp}; Check: HasWI30; MinVersion: {#MinVer}; Components: ClientComponent;
549559
Source: {#WOW64Dir}\system32\vccrt{#msvc_runtime_library_version}_Win32.msi; DestDir: {tmp}; Check: HasWI30; MinVersion: {#MinVer}; Components: ClientComponent;
550-
#else
560+
#elif PlatformTarget == "Win32"
551561
Source: {#FilesDir}\system32\vccrt{#msvc_runtime_library_version}_Win32.msi; DestDir: {tmp}; Check: HasWI30; MinVersion: {#MinVer}; Components: ClientComponent;
562+
#elif PlatformTarget == "arm64"
563+
; Source: {#FilesDir}\system32\vccrt{#msvc_runtime_library_version}_arm64.msi; DestDir: {tmp}; Check: HasWI30; MinVersion: {#MinVer}; Components: ClientComponent;
552564
#endif
553565
#endif
554566

builds/win32/clean_all.bat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ for %%v in ( %* ) do (
2222
@echo Cleaning icu...
2323
@rmdir /S /Q "%FB_ROOT_PATH%\extern\icu\%FB_TARGET_PLATFORM%\%FBBUILD_BUILDTYPE%" 2>nul
2424

25-
@echo Cleaning cds...
26-
@for /D %%d in ("%FB_ROOT_PATH%\extern\libcds\obj\*") do (
27-
rmdir /S /Q "%%d\%FB_TARGET_PLATFORM%\cds\%FB_CONFIG%-static" 2>nul
25+
if not "%FB_TARGET_PLATFORM%"=="arm64" (
26+
@echo Cleaning cds...
27+
@for /D %%d in ("%FB_ROOT_PATH%\extern\libcds\obj\*") do (
28+
rmdir /S /Q "%%d\%FB_TARGET_PLATFORM%\cds\%FB_CONFIG%-static" 2>nul
29+
)
30+
@for /D %%d in ("%FB_ROOT_PATH%\extern\libcds\bin\*") do (
31+
rmdir /S /Q "%%d\%FB_TARGET_PLATFORM%-%FB_CONFIG%-static" 2>nul
32+
)
2833
)
2934

30-
@for /D %%d in ("%FB_ROOT_PATH%\extern\libcds\bin\*") do (
31-
rmdir /S /Q "%%d\%FB_TARGET_PLATFORM%-%FB_CONFIG%-static" 2>nul
32-
)
33-
34-
3535
@echo Cleaning decNumber...
3636
@rmdir /S /Q "%FB_ROOT_PATH%\extern\decNumber\lib\%FB_TARGET_PLATFORM%" 2>nul
3737
@rmdir /S /Q "%FB_ROOT_PATH%\extern\decNumber\temp\%FB_TARGET_PLATFORM%" 2>nul

builds/win32/make_boot.bat

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ if "!ERRLEV!"=="1" goto :END
5151
call :btyacc
5252
if "!ERRLEV!"=="1" goto :END
5353

54-
call :libcds
55-
if "!ERRLEV!"=="1" goto :END
54+
if not "%FB_TARGET_PLATFORM%"=="arm64" (
55+
call :libcds
56+
if "!ERRLEV!"=="1" goto :END
57+
)
5658

5759
echo Generating DSQL parser...
5860
call parse.bat %*
@@ -176,10 +178,13 @@ goto :EOF
176178
@echo.
177179
@echo Building ttmath (%FB_OBJ_DIR%)...
178180
@mkdir %FB_ROOT_PATH%\extern\ttmath\%FB_CONFIG% 2>nul
179-
if /I "%FB_CONFIG%"=="debug" (
180-
@ml64.exe /c /Zi /Fo %FB_ROOT_PATH%\extern\ttmath\%FB_CONFIG%\ttmathuint_x86_64_msvc.obj %FB_ROOT_PATH%\extern\ttmath\ttmathuint_x86_64_msvc.asm
181-
) else (
182-
@ml64.exe /c /Fo %FB_ROOT_PATH%\extern\ttmath\%FB_CONFIG%\ttmathuint_x86_64_msvc.obj %FB_ROOT_PATH%\extern\ttmath\ttmathuint_x86_64_msvc.asm
181+
182+
if not "%FB_TARGET_PLATFORM%"=="arm64" (
183+
if /I "%FB_CONFIG%"=="debug" (
184+
@ml64.exe /c /Zi /Fo %FB_ROOT_PATH%\extern\ttmath\%FB_CONFIG%\ttmathuint_x86_64_msvc.obj %FB_ROOT_PATH%\extern\ttmath\ttmathuint_x86_64_msvc.asm
185+
) else (
186+
@ml64.exe /c /Fo %FB_ROOT_PATH%\extern\ttmath\%FB_CONFIG%\ttmathuint_x86_64_msvc.obj %FB_ROOT_PATH%\extern\ttmath\ttmathuint_x86_64_msvc.asm
187+
)
183188
)
184189
if errorlevel 1 call :boot2 ttmath_%FB_OBJ_DIR%
185190
goto :EOF

0 commit comments

Comments
 (0)