darwinarm64: native Apple Silicon port — Mach kernel, W^X, AAPCS64 FFI, ObjC bridge, Cocoa IDE - #586
darwinarm64: native Apple Silicon port — Mach kernel, W^X, AAPCS64 FFI, ObjC bridge, Cocoa IDE#586egao1980 wants to merge 1 commit into
Conversation
Apple Silicon bring-up on the arm64 branch (Linux/arm64 already boots). - lisp-kernel/darwinarm64/Makefile builds darm64cl (ASLR; no pagezero) - Expand platform-darwinarm64.h; stub Mach TCR hooks (Unix signals for now) - Darwin syscall path (x16 + svc #0x80, carry → -errno) - Assembler: bcond_ext + ADRP for lisp_nil (Darwin as/ld constraints) - darwin_sigreturn; tools/xdarwinarm64.lisp Verified: make -C lisp-kernel/darwinarm64 produces a Mach-O arm64 binary that runs and looks for darm64cl.image.
|
Note: this was opened from an automated agent without the fork owner's explicit request to send upstream. Closing/keeping closed is correct; further Darwin/arm64 work stays on https://github.com/egao1980/ccl/tree/cursor/darwin-arm64-8969 until/unless an upstream PR is requested. |
|
I have a darwinarm64 lisp kernel build Makefile and directory. You can keep working on your own if you want, but as soon as I can get the chance, I'll check in what I've been working on. |
|
UDF hunt (b4f7a9f): Historical |
|
Verified end-to-end: |
Summary
Native Darwin/arm64 (Apple Silicon) port on top of the
arm64branch: Mach exception server, MAP_JIT-based W^X, Apple AAPCS64 FFI, ObjC bridge, and the Cocoa IDE. The stock build path works like other platforms:(rebuild-ccl :full t)self-hosts, and(require :cocoa-application)builds Clozure CL64.app.The branch is squashed into seven commits:
arm64-darwin-mach.c), MAP_JIT W^X policy (purify →AREA_READONLYRX, dynamic heap never executable), GC corrupt-header diagnostics, image/thread/syscall support,lisp-kernel/darwinarm64/build.%ff-callparity, sharedlib/ffi-arm64.lisp, and a fix for GC-invisible.SPffcallstate (raw return PC parked on the vstack could alias an ivector header and hide older vstack slots from mark/forward; save0–save3 now spill around foreign calls).objc_msgSend*_streton arm64,call-next-methodover ObjC methods, untitled Listener at launch, Trace/Source/Inspect selection fixes..cdbdatabases from the current SDK with ffigen5 (databases themselves stay out of the tree).rebuild-cclintegration, dumplisp MAP_JIT handling.tools/run-darwin-arm64-ci.sh.doc/porting/darwin.md,doc/porting/progress.md.Validation
(rebuild-ccl :full t)twice (second rebuild self-hosted from the produced image)ccl-testssuite 244/244; ANSI+CCLtest-ccl-and-suites21920/21920tools/run-darwin-arm64-ci.sh): purify, cocoa, interp-ff-call, clean build,(require :cocoa)/Hemlock, mini-apps 01–17Relation to the current
arm64branchThis branch is based on an earlier
arm64state. Since then the branch gained the linuxarm64 AAPCS64 FFI rework (#572) and the consolidation of the splitspentry-[B-E]*.sfiles intoarm64-spentry.s, which overlap the FFI/spentry commits here (13 conflicting files). The two implementations agree on the ABI but differ in mechanism (ffcall/callback convention, file layout), so reconciling onto the current tip is a follow-up step — happy to coordinate on which convention should win before rebasing.GitHub does not allow reopening this PR (the head branch was recreated after it was closed); superseded by #599, which is rebased onto the current
arm64tip with the overlap reconciled.