{"id":49769782,"url":"https://github.com/sysprog21/elfuse","last_synced_at":"2026-05-11T12:12:34.911Z","repository":{"id":355592623,"uuid":"1228737598","full_name":"sysprog21/elfuse","owner":"sysprog21","description":"Run Arm64/Linux ELF binaries on macOS Apple Silicon","archived":false,"fork":false,"pushed_at":"2026-05-04T10:35:47.000Z","size":522,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-04T12:33:17.986Z","etag":null,"topics":["arm64","darwin-kernel","hypervisor-framework","linux-compatibility","linux-syscall","macos"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysprog21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-04T10:21:48.000Z","updated_at":"2026-05-04T11:05:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sysprog21/elfuse","commit_stats":null,"previous_names":["sysprog21/elfuse"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sysprog21/elfuse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Felfuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Felfuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Felfuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Felfuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysprog21","download_url":"https://codeload.github.com/sysprog21/elfuse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Felfuse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32894155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm64","darwin-kernel","hypervisor-framework","linux-compatibility","linux-syscall","macos"],"created_at":"2026-05-11T12:12:34.307Z","updated_at":"2026-05-11T12:12:34.905Z","avatar_url":"https://github.com/sysprog21.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elfuse\n\n`elfuse` runs aarch64-linux ELF binaries on macOS Apple Silicon through\nApple's Hypervisor.framework. It is a process-scoped Linux user-space runtime:\nguest code executes on the CPU inside a lightweight VM, while Linux syscalls\nare intercepted and translated to macOS behavior in host-side handlers.\n\nThis is not a container engine and not a general-purpose Linux kernel. It is a\nfocused compatibility layer for running Linux user-space workloads directly from\nthe macOS shell, with support for static binaries, dynamic loaders via\n`--sysroot`, guest threads, process management, signals, `/proc` emulation, and\nguest debugging through a built-in GDB RSP stub.\n\n## Highlights\n\n- Native Apple Silicon execution through Hypervisor.framework\n- Static and dynamically linked `aarch64-linux` ELF binaries\n- Linux-style processes, threads, signals, timers, futexes, and polling\n- Synthetic `/proc` and selected `/dev` emulation for user-space probes\n- Built-in GDB Remote Serial Protocol stub usable from `gdb` or `lldb`\n- Self-contained test matrix that cross-checks elfuse against QEMU\n\n## Requirements\n\n- macOS on Apple Silicon\n- macOS 13 or newer\n- Xcode Command Line Tools, `clang`, `codesign`, and GNU `make`\n- GNU `objcopy` from Homebrew `binutils`, or `llvm-objcopy`\n- Hypervisor entitlement: `com.apple.security.hypervisor`\n\nFor guest test binaries, the project also expects an AArch64 Linux cross\ntoolchain. The default paths in `mk/toolchain.mk` target the toolchain layout\nused by the repository test harness, but `CROSS_COMPILE` and\n`BAREMETAL_CROSS` are overridable.\n\nTo run `make check`, install the Homebrew AArch64 embedded toolchain first:\n\n```sh\nbrew install --cask gcc-aarch64-embedded\n```\n\n## Quick Start\n\n```sh\ngit clone https://github.com/sysprog21/elfuse\ncd elfuse\nmake elfuse\nmake test-busybox\nbuild/elfuse build/busybox\n```\nReplace `build/busybox` with Arm64/Linux executable files.\n\nFor dynamically linked guests:\n\n```sh\nbuild/elfuse --sysroot /path/to/sysroot ./path/to/program\n```\n\nFor early debugging:\n\n```sh\nbuild/elfuse --gdb 1234 --gdb-stop-on-entry ./path/to/program\n```\n\nThe build signs `build/elfuse` before use. Override the signing identity with\n`SIGN_IDENTITY=\"Developer ID ...\"` when needed.\n\n## Documentation\n\n- [docs/usage.md](docs/usage.md): command-line options, dynamic linking via\n  `--sysroot`, and attaching `gdb` / `lldb` to the built-in stub.\n- [docs/testing.md](docs/testing.md): build prerequisites, the `make check`\n  flow, the QEMU cross-check matrix, and fixture handling.\n- [docs/internals.md](docs/internals.md): canonical technical reference —\n  HVF constraints, EL1 shim and HVC protocol, page-table splitting, syscall\n  translation tables, threads/futex, fork/clone IPC, signals, ptrace, and\n  the GDB stub.\n\n## Build And Validation\n\nMost common targets:\n\n```sh\nmake elfuse        # build and codesign build/elfuse\nmake check         # quick unit suite + BusyBox applet smoke\nmake test-gdbstub  # debugger integration\nmake test-matrix   # cross-check elfuse against QEMU on the same corpus\nmake lint          # clang-tidy\n```\n\n`make check` is the recommended pre-commit gate. `make test-matrix` is the\nrecommended gate for changes touching procfs, dynamic linking, networking,\nor process semantics. See [docs/testing.md](docs/testing.md) for the full\ntarget list, fixture flow, and validation-by-change-type guidance.\n\n## Scope And Limitations\n\n`elfuse` targets pragmatic Linux user-space compatibility. Supported areas\ninclude ELF and dynamic-loader bootstrap, sysroot-aware path translation,\nLinux-style FD semantics, `fork` / `clone` / `execve` / `wait*` / ptrace,\nsignals and timers, polling families (`epoll`, `eventfd`, `signalfd`,\n`timerfd`, `inotify`), sockets and netlink, and synthetic `/proc`, `/dev`,\nand `/proc/net/*` views sufficient for tools such as BusyBox `ps`, `uptime`,\nand `top`.\n\nBoundaries to be aware of:\n\n- The target is Linux user-space ABI compatibility, not kernel\n  virtualization. `/proc`, `/dev`, and mount data are compatibility views.\n- HVF allows one VM per host process, so Linux-style `fork` is implemented\n  via `posix_spawn` plus state transfer (a fast CoW path is used when\n  available — see [docs/internals.md](docs/internals.md)).\n- `MAP_SHARED` is treated as `MAP_PRIVATE`; this matches single-process\n  guest semantics and unblocks tools that expect file-backed mappings.\n- Unsupported syscalls return Linux-style errors rather than silently\n  succeeding.\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE).\n\nCopyright 2026 elfuse contributors  \nCopyright 2025 Moritz Angermann, zw3rk pte. ltd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysprog21%2Felfuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysprog21%2Felfuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysprog21%2Felfuse/lists"}