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

Cygwin: uname: add host machine tag to sysname #244

Merged

Conversation

jeremyd2019
Copy link
Member

@jeremyd2019 jeremyd2019 commented Nov 29, 2024

This backports two commits from cygwin master, caching IsWow64Process2 and the cygwin module's architecture in wincap, and using this to add a host machine tag to uname's sysname field, like used to be done with -WOW64 when that was supported (see forthcoming PR to 3.3.6 for more complete version that includes handling of i686 cases, which were removed during review before applying to cygwin, since they no longer support i686)

Closes #238

Jeremy Drake added 2 commits November 29, 2024 13:22
This was already used in the FAST_CWD check, and could be used in a
couple other places.

I found the "emulated"/process value returned from the function largely
useless, so I did not cache it.  It is useless because, as the docs say,
it is set to IMAGE_FILE_MACHINE_UNKNOWN (0) if the process is not
running under WOW64, but Microsoft also doesn't consider x64-on-ARM64 to
be WOW64, so it is set to 0 regardless if the process is ARM64 or x64.
You can tell the difference via
GetProcessInformation(ProcessMachineTypeInfo), but for the current
process even that's overkill: what we really want to know is the
IMAGE_FILE_MACHINE_* constant for the Cygwin dll itself, which is
conveniently located in memory already, so cache that in wincap also for
easy comparisons.

Signed-off-by: Jeremy Drake <[email protected]>
(cherry picked from commit 46f7bcc)
If the Cygwin dll's architecture is different from the host system's
architecture, append an additional tag that indicates the host system
architecture (the Cygwin dll's architecture is already indicated in
machine).

Signed-off-by: Jeremy Drake <[email protected]>
(cherry picked from commit 7923059)
@dscho dscho merged commit 8d847f4 into msys2:msys2-3.5.4 Dec 1, 2024
1 check passed
@jeremyd2019 jeremyd2019 deleted the msys2-3.5.4-wincap-wow64process2 branch December 1, 2024 17:32
dscho added a commit to dscho/MSYS2-packages that referenced this pull request Dec 2, 2024
This backports the `uname` patches from Cygwin where Windows/ARM64 is
indicated by an `-ARM64` suffix.

It corresponds to msys2/msys2-runtime#245 and
msys2/msys2-runtime#244.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Collaborator

dscho commented Dec 2, 2024

➡️msys2/MSYS2-packages#5035

lazka pushed a commit to msys2/MSYS2-packages that referenced this pull request Dec 5, 2024
This backports the `uname` patches from Cygwin where Windows/ARM64 is
indicated by an `-ARM64` suffix.

It corresponds to msys2/msys2-runtime#245 and
msys2/msys2-runtime#244.

Signed-off-by: Johannes Schindelin <[email protected]>
stahta01 pushed a commit to stahta01/MSYS2-cygwin-packages that referenced this pull request Dec 21, 2024
This backports the `uname` patches from Cygwin where Windows/ARM64 is
indicated by an `-ARM64` suffix.

It corresponds to msys2/msys2-runtime#245 and
msys2/msys2-runtime#244.

Signed-off-by: Johannes Schindelin <[email protected]>
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.

identify arm64 host in uname output?
2 participants