Skip to content

Cygwin: enable initial AArch64 config and register context - #359

Closed
crutkas wants to merge 6 commits into
msys2:msys2-3.6.10from
crutkas:crutkas-fix-aarch64-configure-blocker
Closed

Cygwin: enable initial AArch64 config and register context#359
crutkas wants to merge 6 commits into
msys2:msys2-3.6.10from
crutkas:crutkas-fix-aarch64-configure-blocker

Conversation

@crutkas

@crutkas crutkas commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Backport the first two accepted Cygwin AArch64 prerequisites to the msys2-3.6.10 line:

  • allow aarch64 through the winsup target-processor gate and define TARGET_AARCH64
  • add the accepted AArch64 CONTEXT/__mcontext layout and portable register aliases used by exceptions, profiling, and pthread cancellation
  • add configure coverage for aarch64-pc-cygwin and a digest-pinned AArch64 compile check for the register layout/aliases

This intentionally uses aarch64-pc-cygwin, not aarch64-pc-msys: since #303, MSYS2 builds the runtime with the Cygwin triplet and applies MSYS behavior in runtime sources. It does not reintroduce the stale *-*-msys configury from #356.

Upstream provenance

No parent commit of aeea9ae was required; its parent is unrelated malloc-wrapper work. The only cherry-pick conflict was with the newer pthread stack-alignment fix already on this branch. It is resolved to current upstream behavior: x86_64 retains SP % 16 == 8, while AArch64 aligns SP to 16 bytes before redirecting the instruction pointer.

Validation

The seven downstream msys2-tests matrix jobs reached their shared keyring test and then failed for the same external trust error: Key 87771331B3F1FF5263856A6D974C8BE49078F532 does not have full trust. This is unrelated to the runtime diff; preceding tests completed normally.

Next blocker

A one-time full AArch64 build probe advanced past this patch and stopped while compiling newlib/libm/math/k_standard.c:

winsup/cygwin/include/cygwin/config.h:42:2: error: #error unimplemented for this target

That is the x86_64-only inline __getreent() stack-base lookup. Its accepted upstream fix is cygwin/cygwin@e97c157.

The later signal/SEH implementation is deliberately not folded into this PR. It is a larger, non-contiguous accepted series beginning with the gendef stubs (f38c75a), incorporating the AArch64 gendef/sigdelayed work and the VEH fix (b0a9b62), then converging through 0cde89e5f5462d2a953c14054e78bc99666. That series should be reviewed separately with its intervening ABI/newlib prerequisites.

crutkas and others added 3 commits August 13, 2026 09:38
Allow the accepted aarch64 target through winsup configury and define its Automake conditional. Add configure-only CI coverage for both the existing x86_64 target and AArch64.\n\nThe winsup change backports cygwin/cygwin@2138e80.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Backport accepted Cygwin commit aeea9ae for AArch64 CONTEXT and mcontext register mappings.

Resolve the later pthread cancellation stack-alignment change to match current upstream: preserve the x86_64 path and align AArch64 SP to 16 bytes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Compile the Cygwin mcontext layout and portable register aliases with the published aarch64-pc-cygwin toolchain. Temporarily probe the subsequent full-build failure so the next blocker can be identified precisely.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@dscho

dscho commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

@crutkas how much coordination exists between your effort and @aswin-mcw's in #356? I don't want friction of two independent efforts trying to achieve the same goal. I want synergy.

crutkas and others added 3 commits August 13, 2026 10:20
The published aarch64-pc-cygwin toolchain contains ARM64-hosted binaries, so execute the register-context check on GitHub's ARM64 Ubuntu runner.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Compile the internal cygwin/signal.h with the same foundational types supplied by the public signal header.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the one-time full-build probe now that it identified the next blocker. Keep the digest-pinned AArch64 compile check as the permanent regression test.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@crutkas crutkas changed the title Cygwin: configure winsup for AArch64 Cygwin: enable initial AArch64 config and register context Aug 13, 2026
@crutkas crutkas closed this Aug 13, 2026
@crutkas

crutkas commented Aug 13, 2026

Copy link
Copy Markdown
Author

I'm actively working on a prototype, this was supposed to be self contained under my own fork. Thanks for making me aware of that effort. My goal is not to cause friction at all

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