Skip to content

feat: add --macos backend to jda1 with syscall translation#12

Merged
jailalawat merged 2 commits into
mainfrom
issue-2-global-copy-prop
May 19, 2026
Merged

feat: add --macos backend to jda1 with syscall translation#12
jailalawat merged 2 commits into
mainfrom
issue-2-global-copy-prop

Conversation

@jailalawat

Copy link
Copy Markdown
Contributor

Translate Linux syscall numbers to macOS BSD numbers at JIR emit time via macos_xlat_nr_id() helper called from codegen_syscall_inline(). Translation covers: read(0), write(1), open(2), close(3), mmap(9), munmap(11), exit(60), gettimeofday(96), exit_group(231).

All 5 benchmarks now run natively on macOS (Rosetta 2, x86-64 Mach-O):
sudoku 500/500 solved, 46ms
lz77 verified, 282ms
btree 44863 nodes, 640ms
regex 198 matches, 183ms
raytracer checksum 1285549368, 328ms

Self-host converges at 2,050,465 bytes.

Also update benchmarks to use gettimeofday (syscall 96) for timing instead of clock_gettime (syscall 228) which has no direct macOS equiv.

Translate Linux syscall numbers to macOS BSD numbers at JIR emit time
via macos_xlat_nr_id() helper called from codegen_syscall_inline().
Translation covers: read(0), write(1), open(2), close(3), mmap(9),
munmap(11), exit(60), gettimeofday(96), exit_group(231).

All 5 benchmarks now run natively on macOS (Rosetta 2, x86-64 Mach-O):
  sudoku   500/500 solved, 46ms
  lz77     verified, 282ms
  btree    44863 nodes, 640ms
  regex    198 matches, 183ms
  raytracer checksum 1285549368, 328ms

Self-host converges at 2,050,465 bytes.

Also update benchmarks to use gettimeofday (syscall 96) for timing
instead of clock_gettime (syscall 228) which has no direct macOS equiv.
@jailalawat jailalawat merged commit 79f9a8a into main May 19, 2026
6 checks passed
@jailalawat jailalawat deleted the issue-2-global-copy-prop branch May 19, 2026 04:06
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.

1 participant