fix(os/darwin): load aarch64 syscall operands with ldr, not mov#317
Merged
Conversation
the darwin aarch64 syscall wrappers moved the syscall number and
arguments into registers with 'mov xN, {operand}', but those operands
bind to stack slots and arm64 'mov' only accepts a register or immediate
source, so the encoder rejected them with 'inline-asm mov source must be
a register or immediate'. switch every slot-bound source to 'ldr',
mirroring the linux aarch64 path. covers syscall0..6 plus the fork/vfork
wrappers, which carried the same 'mov x16, {n}'. x86_64 wrappers are
untouched (x86 mov takes a memory source).
Closes #315
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The darwin aarch64 syscall wrappers in
src/system/os/darwin/shared.machmoved the syscall number and arguments into registers withmov xN, {operand}. Those operands bind to stack slots, but arm64movonly accepts a register or immediate source, so the encoder rejected them:This failed compilation for
--target darwin-aarch64before linking.Fix: switch every slot-bound source to
ldr, mirroring the linux aarch64 syscall path (which already usesldr xN, {aN}). Coverssyscall0..syscall6plus thefork/vforkwrappers, which carried the samemov x16, {n}.The x86_64 wrappers (
mov rdi, {a0}) are left untouched — x86movaccepts a memory source. The arch-specificpipewrapper inaarch64.machalready uses an immediate (mov x16, 42), which is valid, so it is unchanged.Closes #315
🤖 Generated with Claude Code