You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds LC_UUID to direct Mach-O executables so dyld will actually run them.\n\nChecked with:\n\nsh\nmake -C native/zero-c\n.zero/bin/zero run examples/hello.0\n
Confirmed this fixes the dyld error on macOS 26.4 / Darwin 25.4.0 arm64 — the salted hash + v4 bit-setting in macho_make_uuid are nice touches. Worth pairing the emit fix with a byte-level regression assertion so the bug can't silently come back. The assertMachOArm64Executable helper in conformance/run.mjs already runs for the direct exe test (around line 703) and doesn't currently scan load commands — adding a small walk catches missing LC_UUID even from a Linux sandbox where the binary can't be exec'd.
Suggested addition inside assertMachOArm64Executable, right after the existing asserts:
js // dyld rejects Mach-O executables without LC_UUID on recent macOS. const ncmds = bytes.readUInt32LE(16); let cursor = 32; let hasUuid = false; for (let i = 0; i < ncmds; i++) { const cmd = bytes.readUInt32LE(cursor); const cmdSize = bytes.readUInt32LE(cursor + 4); if (cmd === 0x1b) { hasUuid = true; break; } cursor += cmdSize; } assert(hasUuid, "Mach-O executable is missing LC_UUID load command");
Verified locally: trips on a binary with LC_UUID surgically removed, passes on the binary this PR produces.
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
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.
Adds LC_UUID to direct Mach-O executables so dyld will actually run them.\n\nChecked with:\n\n
sh\nmake -C native/zero-c\n.zero/bin/zero run examples/hello.0\n