Skip to content

Add support for Windows on ARM64 #1

Closed

Description

@ader1990

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, as there is no support. Do you have any pointers on how this can be achieved?

I have also opened python-greenlet/greenlet#220 for guidance.

Thank you,
Adrian

Activity

  1. kristjanvalur commented on Nov 24, 2020

    @kristjanvalur
    Collaborator

    Unfortunately I have not touched the greenlet project for a long time. The stack slicing code split up years ago from Stackless python into the Greenlet project.

    I have already done this for the "stackman" project. I would suggest that you look at the difference between the ARM and ARM32 code here in this repository (the switch_arm_gcc.h and the switch_aarch64_gcc.h) look at the differences, and apply similar changes to the greenlet, creating a switcg_aarch64_gcc.h there.
    The switching code cannot be taken directly since the arguments are slightly different. It will be mostly a case of renaming the registers (from r to x) and noticing the different register numbers that need to be preserved across calls for both architectures.

  2. kristjanvalur commented on Nov 24, 2020

    @kristjanvalur
    Collaborator

    Another approach would be to create a shim, and actually use the stackman project here. I aim to actually submit the libs for the different arthcitectures into the repository.
    In the stackless project, I made a PR that illustrates how the slp_switch() function can be implemented in terms of stackman_switch():

    stackless-dev/stackless#230
    Ideally, when I manage to make this project stable and have released libs available for all major platforms, projects like stackless and greenlets can actually just link with the comman code here.

    I still haven't finished windows support for stackman, though. And I don't support any of the legacy platforms. Only arm, x86linux and x86 windows. (32 and 64) bits.

  3. kristjanvalur commented on Nov 29, 2020

    @kristjanvalur
    Collaborator

    Hm, I see that you speak of windows/arm64. This is new to me. I have to finalize windows/86 support in this lib first, then maybe if I can get access to an ARM64 win machine....

  4. kristjanvalur commented on Apr 5, 2021

    @kristjanvalur
    Collaborator

    windows support for X86/64 bit is complete, and theoretically it should also work for windows 10 on aarch64, but I have not had access to such a platform to test.

  5. added a commit that references this issue on Apr 6, 2021
  6. kristjanvalur commented on Sep 8, 2024

    @kristjanvalur
    Collaborator

    Github will be adding arm64 support by the end of the year to open source repos. i'll update the tealet repo to test the stackman code on windows 64 once that happens.
    https://github.blog/news-insights/product-news/arm64-on-github-actions-powering-faster-more-efficient-build-systems/

  7. kristjanvalur commented on Oct 16, 2026

    @kristjanvalur
    Collaborator

    Closing this. Windows ARM64 is a supported ABI in this repository.

    win_arm64 is implemented by stackman/platforms/switch_arm64_msvc.asm and switch_arm64_msvc.h. platform.h selects it for _M_ARM64. The name win_aarch64 is accepted and normalized to win_arm64. The VS2022 solution builds it, and .github/workflows/buildcommit.yml builds Platform=arm64 on every pull request. The 1.3.0 sources spill FPCR and FPSR there and keep the TEB register x18 restored rather than using it as a scratch.

    The arm64 job is a cross build, so CI does not execute test.exe on Windows ARM64. The implementation and the build are what this issue asked for. Runtime coverage on that OS is still the x86 and x64 jobs.

    The other open items stay open. Stack overflow helpers are still only a proposal (#14). STACKMAN_HAVE_CALL is removed in a separate change, aimed at 1.4.0 (#16).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions