Skip to content

[ARM64 POC - OLD] Cygwin: enable initial AArch64 config and register context - #1

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

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

Conversation

@crutkas

@crutkas crutkas commented Aug 13, 2026 •

Copy link
Copy Markdown
Owner

Caution

OLD ARM64 POC - REFERENCE ONLY

Do not merge. Do not use as a PR base. Do not add to a new stack. Do not consume its build artifacts.
vNext epoch: 2026-08-31-v1
Classification: POC-SUPERSEDED
Replacement: pending

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 msys2#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 msys2#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 0cde89e → 5f5462d → 2a953c1 → 4054e78 → bc99666. That series should be reviewed separately with its intervening ABI/newlib prerequisites.

crutkas and others added 6 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>
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: enable initial AArch64 config and register context [ARM64 POC - OLD] Cygwin: enable initial AArch64 config and register context Aug 31, 2026
@crutkas crutkas added arm64-poc-old Old ARM64 programme; never a vNext base or input arm64-poc-superseded Replacement identified; retained for evidence labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arm64-poc-old Old ARM64 programme; never a vNext base or input arm64-poc-superseded Replacement identified; retained for evidence

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants