Skip to content

Add support for Windows on ARM64 #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ader1990 opened this issue Nov 23, 2020 · 1 comment
Closed

Add support for Windows on ARM64 #220

ader1990 opened this issue Nov 23, 2020 · 1 comment

Comments

@ader1990
Copy link

ader1990 commented Nov 23, 2020

Hello,

I am trying to use greenlet with Python 3.8 / 3.9 on Windows ARM64, but there is a compilation issue when I try building it using VS Studio 2017 / 2019:

src/greenlet/greenlet.c(353): fatal error C1189: #error:          "greenlet needs to be ported to this platform, or taught how to detect your compiler properly."

It seems there has to be a special switch implementation here for ARM64, but currently I do not know how to tackle it:
https://github.com/python-greenlet/greenlet/blob/master/src/greenlet/slp_platformselect.h#L8

Can anyone help me with some pointers for the win32 ARM64 switch?

Thank you,
Adrian

ader1990 added a commit to ader1990/greenlet that referenced this issue Dec 10, 2020
The patch adds platform implementation for win32 llvm reusing
platform/switch_aarch64_gcc.h and fixes the stackref type to
int64_t, as long is considered to be 32bit by llvm-mingw.

The .pyd extension for greenlet can be manually built using:
https://github.com/mstorsjo/llvm-mingw.

How to set the env to build a working .pyd:

  * Install mingw64 or mingw32
  * Download the llvm-mingw binaries and add them to path
    https://github.com/mstorsjo/llvm-mingw/releases
  * Download a Python 3.9 build for ARM64 and unzip in greenlet/src/greenlet
    https://github.com/ader1990/cpython-builder/actions/runs/377798403

How to build the .pyd using llvm-mingw:

  * cd greenlet/src/greenlet
  * aarch64-w64-mingw32-clang -c greenlet.c -o greenlet.o -I./cpython/include
  * aarch64-w64-mingw32-clang -shared -o _greenlet.cp39-win_arm64.pyd greenlet.o -L./cpython/libs -l:python3.lib -l:python39.lib

Partially-fixes: python-greenlet#220
@jamadden
Copy link
Contributor

jamadden commented Nov 2, 2021

Fixed by #271

@jamadden jamadden closed this as completed Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants