-
Notifications
You must be signed in to change notification settings - Fork 65
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
base: master
Are you sure you want to change the base?
Conversation
Workflow:
I am not sure how it is related to the change proposed by the PR. 🤔 Could anyone help with it? |
#elif defined(x86_64_HOST_ARCH) | ||
, rax, rbx, rcx, rdx, rsi, rdi, rbp, rip, rsp | ||
#endif |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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? |
Co-authored-by: Cheng Shao <terrorjack@type.dance>
See details: https://gitlab.haskell.org/ghc/ghc/-/issues/24603#note_565835