Skip to content

Commit bbbf9bb

Browse files
Anselm KruisAnselm Kruis
Anselm Kruis
authored and
Anselm Kruis
committed
Stackless issue python#296: support Windows on ARM and ARM64
It is now possible to cross-compile Stackless for Windows on ARM and ARM64.
1 parent b8829fb commit bbbf9bb

File tree

6 files changed

+57
-3
lines changed

6 files changed

+57
-3
lines changed

Include/stackless.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern "C" {
6363
/* Linux/S390 zSeries */
6464
#elif defined(__GNUC__) && defined(__mips__) && defined(__linux__)
6565
/* MIPS */
66-
#else
66+
#elif defined(SLP_NO_STACKMAN)
6767
/* no supported platform */
6868
#undef STACKLESS
6969
#endif

Include/stackless_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ STACKLESS_RETRACT()
500500
#define STACKLESS_RETRACT() assert(1)
501501
#define STACKLESS_ASSERT() assert(1)
502502
#define STACKLESS_VECTORCALL_GETARG(func) int stackless = 0
503-
#define STACKLESS_VECTORCALL_BEFORE(func) (stackless = 0)
504-
#define STACKLESS_VECTORCALL_AFTER(func) (stackless = 0)
503+
#define STACKLESS_VECTORCALL_BEFORE(func) assert(1)
504+
#define STACKLESS_VECTORCALL_AFTER(func) assert(1)
505505
#endif
506506

507507
#define STACKLESS_PROMOTE_METHOD(obj, slot_name) \

PCbuild/_teststackless.vcxproj

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|ARM">
5+
<Configuration>Debug</Configuration>
6+
<Platform>ARM</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|ARM64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>ARM64</Platform>
11+
</ProjectConfiguration>
412
<ProjectConfiguration Include="Debug|Win32">
513
<Configuration>Debug</Configuration>
614
<Platform>Win32</Platform>
@@ -9,6 +17,14 @@
917
<Configuration>Debug</Configuration>
1018
<Platform>x64</Platform>
1119
</ProjectConfiguration>
20+
<ProjectConfiguration Include="PGInstrument|ARM">
21+
<Configuration>PGInstrument</Configuration>
22+
<Platform>ARM</Platform>
23+
</ProjectConfiguration>
24+
<ProjectConfiguration Include="PGInstrument|ARM64">
25+
<Configuration>PGInstrument</Configuration>
26+
<Platform>ARM64</Platform>
27+
</ProjectConfiguration>
1228
<ProjectConfiguration Include="PGInstrument|Win32">
1329
<Configuration>PGInstrument</Configuration>
1430
<Platform>Win32</Platform>
@@ -17,6 +33,14 @@
1733
<Configuration>PGInstrument</Configuration>
1834
<Platform>x64</Platform>
1935
</ProjectConfiguration>
36+
<ProjectConfiguration Include="PGUpdate|ARM">
37+
<Configuration>PGUpdate</Configuration>
38+
<Platform>ARM</Platform>
39+
</ProjectConfiguration>
40+
<ProjectConfiguration Include="PGUpdate|ARM64">
41+
<Configuration>PGUpdate</Configuration>
42+
<Platform>ARM64</Platform>
43+
</ProjectConfiguration>
2044
<ProjectConfiguration Include="PGUpdate|Win32">
2145
<Configuration>PGUpdate</Configuration>
2246
<Platform>Win32</Platform>
@@ -25,6 +49,14 @@
2549
<Configuration>PGUpdate</Configuration>
2650
<Platform>x64</Platform>
2751
</ProjectConfiguration>
52+
<ProjectConfiguration Include="Release|ARM">
53+
<Configuration>Release</Configuration>
54+
<Platform>ARM</Platform>
55+
</ProjectConfiguration>
56+
<ProjectConfiguration Include="Release|ARM64">
57+
<Configuration>Release</Configuration>
58+
<Platform>ARM64</Platform>
59+
</ProjectConfiguration>
2860
<ProjectConfiguration Include="Release|Win32">
2961
<Configuration>Release</Configuration>
3062
<Platform>Win32</Platform>

PCbuild/pcbuild.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,18 +1442,34 @@ Global
14421442
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|Win32.Build.0 = Release|Win32
14431443
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|x64.ActiveCfg = Release|x64
14441444
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|x64.Build.0 = Release|x64
1445+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|ARM.ActiveCfg = Debug|ARM
1446+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|ARM.Build.0 = Debug|ARM
1447+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|ARM64.ActiveCfg = Debug|ARM64
1448+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|ARM64.Build.0 = Debug|ARM64
14451449
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|Win32.ActiveCfg = Debug|Win32
14461450
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|Win32.Build.0 = Debug|Win32
14471451
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|x64.ActiveCfg = Debug|x64
14481452
{32E0DA61-316A-49D0-988B-17861FC7356B}.Debug|x64.Build.0 = Debug|x64
1453+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM
1454+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|ARM.Build.0 = PGInstrument|ARM
1455+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64
1456+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64
14491457
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
14501458
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
14511459
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
14521460
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGInstrument|x64.Build.0 = PGInstrument|x64
1461+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM
1462+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|ARM.Build.0 = PGUpdate|ARM
1463+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64
1464+
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64
14531465
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
14541466
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
14551467
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
14561468
{32E0DA61-316A-49D0-988B-17861FC7356B}.PGUpdate|x64.Build.0 = PGUpdate|x64
1469+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Release|ARM.ActiveCfg = Release|ARM
1470+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Release|ARM.Build.0 = Release|ARM
1471+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Release|ARM64.ActiveCfg = Release|ARM64
1472+
{32E0DA61-316A-49D0-988B-17861FC7356B}.Release|ARM64.Build.0 = Release|ARM64
14571473
{32E0DA61-316A-49D0-988B-17861FC7356B}.Release|Win32.ActiveCfg = Release|Win32
14581474
{32E0DA61-316A-49D0-988B-17861FC7356B}.Release|Win32.Build.0 = Release|Win32
14591475
{32E0DA61-316A-49D0-988B-17861FC7356B}.Release|x64.ActiveCfg = Release|x64

Stackless/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ What's New in Stackless 3.X.X?
99

1010
*Release date: 20XX-XX-XX*
1111

12+
- https://github.com/stackless-dev/stackless/issues/296
13+
It is now possible to cross-compile Stackless for Windows on ARM and ARM64.
14+
1215
- https://github.com/stackless-dev/stackless/issues/295
1316
Add prefix "_slp" to structure names without a prefix. The following structs
1417
were renamed: _channel, _cframe, _tasklet, _unwindobject and _bomb.

Stackless/platf/slp_transfer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include "Python.h"
22
#include <stddef.h> /* For ptrdiff_t */
3+
#ifdef _MSC_VER
4+
#include <malloc.h> /* for alloca */
5+
#endif /* _MSC_VER */
36

47
#ifdef STACKLESS
58

0 commit comments

Comments
 (0)