Build the (ARM/ARM64/i386) Linux Kernel on any macOS host
The macOS Linux Kernel Development Kit includes some bits from glibc to successfully build host tools, which allows a full kernel compile on macOS with little effort.
NOTE: This is still early, and while at the time of this writing, mainline for arm64 and i386 (not amd64) successfully builds on Apple Silicon and Intel, this can change as the kernel continues development. Updates are welcome if things break.
- Install Homebrew for package management.
- Install mac-linux-kdk:
brew install mysticlgbt/made/mac-linux-kdk
- Clone the Linux kernel source to a case-sensitive filesystem. (Use Disk Utility to add a case-sensitive volume)
- Use
lkmake
instead ofmake
to build the Linux kernel.