Conversation
Darwin lacks copy_file_range() and O_LARGEFILE, so the gen_init_cpio host program fails to build and a macOS build of vmlinux.wasm stops in usr/. Force-include a small compat header for that host program on Darwin only: copy_file_range() becomes a read/write loop with the same return contract, and O_LARGEFILE is 0 (off_t is already 64-bit there). Other hosts are unchanged. Tested on macOS 26 (Apple Silicon) with GNU Make 4.4.1 and Homebrew LLVM 19.1.7 (matching flake.nix): defconfig + vmlinux.wasm builds on top of f2a512c, which no longer needs scripts/mod. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kilian-ai
force-pushed
the
pr/wasm-macos-host-build
branch
from
September 29, 2026 19:07
238f842 to
f1a72f8
Compare
This branch has not been deployed
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.
Now that #56 skips
scripts/modfor wasm-ld, one host tool still stops a macOS build ofvmlinux.wasm:usr/gen_init_cpio. Darwin has neithercopy_file_range()norO_LARGEFILE:On Darwin only,
usr/Makefilenow force-includes a small compat header (arch/wasm/scripts/macos-host-compat.h) for that one host program:copy_file_range()becomes a read/write loop with the same return contract;O_LARGEFILEis defined as 0, sinceoff_tis already 64-bit on Darwin.There are no target code changes, and builds on other hosts are unchanged.
Tested on macOS 26 (Apple Silicon) with GNU Make 4.4.1 (Homebrew
make) and Homebrew LLVM 19.1.7, the same major version asllvmPackages_19inflake.nix. On top of f2a512c,make mrproper && make defconfig && make vmlinux.wasmsucceeds. Without this change the same build fails with the errors above.(This PR originally also skipped
scripts/modon Darwin; #56 covers that for every host, so I dropped that part.)🤖 Generated with Claude Code