aarch64-win64: fix try...finally+exit (Bounty Boss), add CI

aarch64-win64: fix try...finally+exit (Bounty Boss)

Fixes the try...finally+exit behaviour on Windows ARM64 so the finally block runs when leaving via exit (or break/continue). Addresses forum topic 66952 (Reply #67) and GitLab #40203.

Summary

  • Compiler (compiler/aarch64/cgcpu.pas): For aarch64-win64, g_local_unwind now emits a call to _FPC_local_unwind (RtlUnwindEx) instead of a plain jump when leaving a try block via exit/break/continue.
  • Compiler (compiler/symtable.pas): Case-insensitive fallback for _fpc_local_unwind in search_system_proc so user compilations find the RTL procedure.
  • Compiler (compiler/fppu.pas): Add symconst to uses for symtable dependency.
  • RTL (rtl/win64/system.pp, rtl/win64/seh64.inc): Declare and implement _fpc_local_unwind via RtlUnwindEx (minimal; no debug code).

Test

Minimal test (Bounty Boss): begintryexitfinallyend. Success criterion: output contains finally when run on Windows ARM64.

  • Test source: generated in CI (workflow creates arm64trap.pas and compiles it).
  • CI: .github/workflows/win-arm64.yml cross-builds on Linux and runs the test on windows-11-arm; the "Run Bounty Boss test" step prints the test code and confirms execution on Windows ARM64. Job passes when output contains "finally".
  • CI proof (passing run): Windows arm64 workflow run — cross-build + Bounty Boss test on windows-11-arm (Success).

Scope

This MR does not include native ppca64 (compiler self-compilation on ARM64) or other phases—only the try...finally+exit fix and the CI that demonstrates it. Change set is minimal: no debug code; test sources generated in workflow.


Forum: https://forum.lazarus.freepascal.org/index.php?topic=66952.0

Merge request reports

Loading