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

identify arm64 host in uname output? #238

Closed
jeremyd2019 opened this issue Nov 17, 2024 · 8 comments · Fixed by #244
Closed

identify arm64 host in uname output? #238

jeremyd2019 opened this issue Nov 17, 2024 · 8 comments · Fixed by #244

Comments

@jeremyd2019
Copy link
Member

I was recently thinking about how uname used to include -WOW64 for i686-on-x86_64 situations, and that it would be possible to use IsWow64Process2 to identify and report x86_64-on-ARM64 (and indeed i686-on-ARM64, if backported to 3.3) in a similar way. That might be useful for stats collection purposes (such as msys2/MSYS2-packages#2832).

I thought to bring this up on cygwin list, but I already have several outstanding messages there that have never been replied to, and I'd much rather my recent patch for hangs on ARM64 get attention, so I figured I'd memorialize the idea here.

@dscho
Copy link
Collaborator

dscho commented Nov 17, 2024

This is a great idea! The only challenge I see is to decide what label to use... we clearly do not want to use aarch64 here lest there is confusion about an ARM64 runtime (which does not exist), and also -WOW64 is inappropriate because it's reserved for i686-on-x86_64, and not for x86_64-on-aarch64...

@jeremyd2019
Copy link
Member Author

jeremyd2019 commented Nov 17, 2024

This is a great idea! The only challenge I see is to decide what label to use... we clearly do not want to use aarch64 here lest there is confusion about an ARM64 runtime (which does not exist), and also -WOW64 is inappropriate because it's reserved for i686-on-x86_64, and not for x86_64-on-aarch64...

Technically, there shouldn't be a confusion, because the arch the runtime is built for is in uname -m, while the -WOW64 tag was in uname -s:

# uname -s
MSYS_NT-10.0-19045-WOW64

# uname -m
i686

Of course, users are prone to confusion 😁

My first thought was appending -WOW64-arm64 (or -aarch64 - I'm not sold on one vs the other) to sysname.

prototype: https://gist.github.com/jeremyd2019/bb17f602da12e0f42aa4ff76848279e8

@lazka
Copy link
Member

lazka commented Nov 18, 2024

Isn't WOW64 separate? It's not used when emulating x64 on arm64 from what I understand.

@jeremyd2019
Copy link
Member Author

I'm not sure - you find out using IsWow64Process2, but it does return IMAGE_FILE_MACHINE_UNKNOWN for the "process"/"emulated" value, which MSDN says means it is not a WOW64 process.

@lazka
Copy link
Member

lazka commented Nov 18, 2024

@jeremyd2019
Copy link
Member Author

@jeremyd2019
Copy link
Member Author

https://inbox.sourceware.org/cygwin/[email protected]/T/

@lazka
Copy link
Member

lazka commented Dec 6, 2024

msys2/msys2-devtools#10

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 a pull request may close this issue.

3 participants