Skip to content
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

Add support for Windows Aarch64 #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GulinSS
Copy link

@GulinSS GulinSS commented Jan 3, 2025

@GulinSS
Copy link
Author

GulinSS commented Jan 4, 2025

Workflow:

ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\WORK\s\appveyor\AppData\Roaming\cabal\config' because it does not exist.

I am not sure how it is related to the change proposed by the PR. 🤔 Could anyone help with it?

Comment on lines +59 to 61
#elif defined(x86_64_HOST_ARCH)
, rax, rbx, rcx, rdx, rsi, rdi, rbp, rip, rsp
#endif
Copy link
Member

@RyanGlScott RyanGlScott Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't strictly necessary to make the library compile on ARM, but I wonder if this module should also define bindings to ARM64-specific registers from ARM64_NT_CONTEXT. (As I understand it, this is the ARM64 equivalent of CONTEXT on x86-64.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add details which ARM64-specific registers do you expect should have been added? These ones?

Sp
Pc
Fpcr
Fpsr

Copy link
Member

@RyanGlScott RyanGlScott Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System.Win32.DebugApi defines general-purpose x86-64 registers, so at a minimum, I think we should include the general-purpose ARM64 registers (X0 through X28, Fp, and Lr). Moreover, System.Win32.DebugApi also defines the x86-64 stack pointer (rsp) and instruction pointer (rip), so I think we should also offer the ARM64 counterparts (Sp and Pc) for consistency.

I don't have a strong feeling about the other registers in ARM64_NT_CONTEXT, so I think it would be fine to omit them. (System.Win32.DebugApi doesn't currently offer bindings to all of the registers in the x86-64 CONTEXT struct, so this is consistent with existing precedent.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Mistuke
Copy link
Contributor

Mistuke commented Jan 7, 2025

Thanks for the PR. I'm somewhat curious about some of the host arch additions, but I'll take a closer look tomorrow.

Though I do wonder if the checks shouldn't be on target arch instead. I'm aware the current ones are on host arch.

@angerman have you folks run into issues here cross compiling to windows?

@GulinSS GulinSS changed the title Add support for Windows ARM Add support for Windows Aarch64 Jan 9, 2025
Co-authored-by: Cheng Shao <terrorjack@type.dance>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants