Issue
On Windows ARM64 with MSYS2 CLANGARM64, the current condition in mruby/throw.h selects the __builtin_setjmp/longjmp path.
In this environment, mruby fails to compile with:
$ rake -m test:run:serial
...
C:/a/mruby/mruby/mrbgems/mruby-compiler/core/codegen.c:6148:3: error: __builtin_setjmp is not supported for the current target
6148 | MRB_TRY(mrb->jmp) {
| ^~~~~~~~~~~~~~~~~
C:/a/mruby/mruby/include/mruby/throw.h:44:26: note: expanded from macro 'MRB_TRY'
44 | #define MRB_TRY(buf) if (MRB_SETJMP((buf)->impl) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~
C:/a/mruby/mruby/include/mruby/throw.h:37:20: note: expanded from macro 'MRB_SETJMP'
37 | #define MRB_SETJMP __builtin_setjmp
| ^
2 warnings and 2 errors generated.
...
ref: https://github.com/otegami/mruby/actions/runs/18304361019/job/52118230538#step:7:63
How to reproduce
I added a Windows-ARM64-CLANG job that reproduces this issue and shows the macro probes.
Please use this CI as a reference when reproducing:
Workflow: otegami#1
Example run: https://github.com/otegami/mruby/actions/runs/18304361019/job/52118230538
Proposed change (minimal & targeted)
There’s a small patch on the MSYS2 side that excludes ARM64 from the MinGW builtin branch by checking _M_ARM64.
Would adopting the same approach here make sense?
ref: msys2/MINGW-packages#24031
I applied the above patch and re-ran CI on my fork. The __builtin_* selection issue appears resolved, but the ARM64 job is still failing for a different reason.
ref: otegami#2
Use case
The Groonga MSYS2 package embeds mruby. Building on Windows ARM64 (MSYS2 CLANGARM64) hits the above compile errors.