Skip to content

Commit cfc147b

Browse files
committed
Add Windows ARM64 support
Currently we do not have fcontext related ASM files for Windows ARM64. So we can use winfib context-impl only for Windows ARM64. Fixes issue : boostorg/boost#1070 Related to PR: boostorg/boost#1077
1 parent a976eaf commit cfc147b

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,40 @@ jobs:
4949
run: |
5050
cd ../boost-root
5151
./b2 -j3 libs/$LIBRARY/test variant=debug,release
52+
windows:
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
os: [ windows-2022, windows-2025, windows-11-arm ]
57+
58+
runs-on: ${{matrix.os}}
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Setup Boost
64+
shell: cmd
65+
run: |
66+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
67+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
68+
echo LIBRARY: %LIBRARY%
69+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
70+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
71+
echo GITHUB_REF: %GITHUB_REF%
72+
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
73+
set BOOST_BRANCH=develop
74+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
75+
echo BOOST_BRANCH: %BOOST_BRANCH%
76+
cd ..
77+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
78+
cd boost-root
79+
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
80+
git submodule update --init tools/boostdep
81+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
82+
cmd /c bootstrap
83+
b2 -d0 headers
84+
- name: Run tests
85+
shell: cmd
86+
run: |
87+
cd ../boost-root
88+
b2 -j3 libs/%LIBRARY%/test variant=debug,release

build/Jamfile.v2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import config : requires ;
1818
project
1919
: common-requirements <library>$(boost_dependencies)
2020
: requirements
21+
<target-os>windows,<architecture>arm,<address-model>64:<context-impl>winfib
2122
<target-os>windows:<define>_WIN32_WINNT=0x0601
2223
<target-os>linux,<toolset>gcc,<segmented-stacks>on:<cxxflags>-fsplit-stack
2324
<target-os>linux,<toolset>gcc,<segmented-stacks>on:<cxxflags>-DBOOST_USE_SEGMENTED_STACKS

test/Jamfile.v2

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ rule native-impl ( properties * )
4141
{
4242
result = <build>no ;
4343
}
44+
else if ( <target-os>windows in $(properties) && <architecture>arm in $(properties) && <address-model>64 in $(properties) )
45+
{
46+
return <context-impl>winfib ; # for windows arm64 always use winfib and skip ASM
47+
}
4448
else if ( ! ( <target-os>windows in $(properties) ) )
4549
{
4650
result = <context-impl>ucontext ;
@@ -52,6 +56,22 @@ rule native-impl ( properties * )
5256
return $(result) ;
5357
}
5458

59+
rule fcontext-impl ( properties * )
60+
{
61+
# Skip on Windows ARM64
62+
if ( <target-os>windows in $(properties) &&
63+
<architecture>arm in $(properties) &&
64+
<address-model>64 in $(properties) )
65+
{
66+
return <build>no ; # for windows arm64 always use winfib and skip fcontext
67+
}
68+
else
69+
{
70+
return <context-impl>fcontext ;
71+
}
72+
}
73+
74+
5575
obj is_libstdcxx : is_libstdcxx.cpp ;
5676
explicit is_libstdcxx ;
5777

@@ -95,7 +115,7 @@ test-suite minimal :
95115

96116
[ run test_fiber.cpp :
97117
: :
98-
<context-impl>fcontext
118+
<conditional>@fcontext-impl
99119
[ requires cxx11_auto_declarations
100120
cxx11_constexpr
101121
cxx11_defaulted_functions
@@ -150,7 +170,7 @@ test-suite minimal :
150170

151171
[ run test_callcc.cpp :
152172
: :
153-
<context-impl>fcontext
173+
<conditional>@fcontext-impl
154174
[ requires cxx11_auto_declarations
155175
cxx11_constexpr
156176
cxx11_defaulted_functions

0 commit comments

Comments
 (0)