AOT binary translator of Linux/ELF → WebAssembly
See the code
An ahead-of-time binary translator that converts Linux applications to WebAssembly for both browser and WASI runtimes.
fork/execve), enabling unmodified Linux apps to runfork/execve support
fork() and execve() system calls in Wasm in browsers. This enables running more complex Linux applications that rely on multi-process architectures, such as shells, build systems, and server applications that spawn child processes (e.g., GNU Bash + BusyBox on the demo page).[!WARNING] elfconv is WORK IN PROGRESS. You may encounter failures when compiling ELF binaries or executing generated Wasm binaries.
runtime/syscalls/ for currently supported syscallsWe measured the performance of Wasm generated by elfconv against Wasm compiled directly from source using Emscripten or WASI-SDK. The workflow is:
Blog: elfconv: Linux Apps to High-Performance Wasm Binary Translator
| Target Program | from source code | elfconv |
|---|---|---|
eratosthenes_sieve (↓ better) | 0.567 (s) (100%) | 0.692 (s) (82%) |
LINPACK benchmark (↑ better) | 1617 (MFLOPS) (100%) | 1256 (MFLOPS) (78%) |
mnist-neural-network-plain-c (during 30 steps) (↑ better) | 2.138 (s) (100%) | 2.255 (s) (96%) |
| Target Program | from source code | elfconv |
|---|---|---|
eratosthenes_sieve (↓ better) | 0.362 (s) (100%) | 0.608 (s) (60%) |
LINPACK benchmark (↑ better) | 4821 (MFLOPS) (100%) | 2720 (MFLOPS) (56%) |
mnist-neural-network-plain-c (during 30 steps) (↑ better) | 2.271 (s) (100%) | 2.302 (s) (96%) |
Pull pre-built image (recommended):
# For ARM64 hosts
$ docker pull ghcr.io/yomaytk/elfconv:arm64
# For x86-64 hosts
$ docker pull ghcr.io/yomaytk/elfconv:amd64
Build from Dockerfile:
$ git clone --recursive https://github.com/yomaytk/elfconv
$ cd elfconv
# For AArch64 ELF target
$ docker build . --build-arg ECV_AARCH64=1
# For x86-64 ELF target
$ docker build . --build-arg ECV_X86=1
For detailed build commands and environment variables, see scripts/README.md.
# 1. Run container with port forwarding
$ docker run -it -p 8080:8080 <image-name>
# 2. Convert ELF to Wasm
~/elfconv# cd bin
~/elfconv/bin# TARGET=aarch64-wasm INITWASM=1 ./exe.sh /path/to/ELF
# Example: TARGET=aarch64-wasm INITWASM=1 ./exe.sh ../examples/hello/c/a.aarch64
# 3. Start web server
~/elfconv/bin# emrun --no_browser --port 8080 <ELFNAME>.html
Access the Wasm application from your browser at http://localhost:8080/<ELFNAME>.html
# 1. Run container
$ docker run -it <image-name>
# 2. Convert ELF to Wasm
~/elfconv# cd bin
~/elfconv/bin# TARGET=aarch64-wasi32 ./exe.sh /path/to/ELF
# Example: TARGET=aarch64-wasi32 ./exe.sh ../examples/hello/c/a.aarch64
# 3. Execute with WasmEdge (preinstalled)
~/elfconv/bin# wasmedge <ELFNAME>.wasm
We'd love your help making it better!
runtime/syscalls/For questions or discussions, feel free to open an issue or start a discussion.
elfconv uses or references some projects as follows. Great thanks to all its developers!
./backend/remill and is modified for using from front-end and supporting additional instructions.browser/js-kernel.js is derived from code generated by Emscripten (MIT licensed).(top 24 of 50)
1,853 followers · starred Jan 2024
828 followers · starred Mar 2026
3,911 followers · starred Mar 2025
556 followers · starred Apr 2025
AOT binary translator of Linux/ELF → WebAssembly
See the code
An ahead-of-time binary translator that converts Linux applications to WebAssembly for both browser and WASI runtimes.
fork/execve), enabling unmodified Linux apps to runfork/execve support
fork() and execve() system calls in Wasm in browsers. This enables running more complex Linux applications that rely on multi-process architectures, such as shells, build systems, and server applications that spawn child processes (e.g., GNU Bash + BusyBox on the demo page).[!WARNING] elfconv is WORK IN PROGRESS. You may encounter failures when compiling ELF binaries or executing generated Wasm binaries.
runtime/syscalls/ for currently supported syscallsWe measured the performance of Wasm generated by elfconv against Wasm compiled directly from source using Emscripten or WASI-SDK. The workflow is:
Blog: elfconv: Linux Apps to High-Performance Wasm Binary Translator
| Target Program | from source code | elfconv |
|---|---|---|
eratosthenes_sieve (↓ better) | 0.567 (s) (100%) | 0.692 (s) (82%) |
LINPACK benchmark (↑ better) | 1617 (MFLOPS) (100%) | 1256 (MFLOPS) (78%) |
mnist-neural-network-plain-c (during 30 steps) (↑ better) | 2.138 (s) (100%) | 2.255 (s) (96%) |
| Target Program | from source code | elfconv |
|---|---|---|
eratosthenes_sieve (↓ better) | 0.362 (s) (100%) | 0.608 (s) (60%) |
LINPACK benchmark (↑ better) | 4821 (MFLOPS) (100%) | 2720 (MFLOPS) (56%) |
mnist-neural-network-plain-c (during 30 steps) (↑ better) | 2.271 (s) (100%) | 2.302 (s) (96%) |
Pull pre-built image (recommended):
# For ARM64 hosts
$ docker pull ghcr.io/yomaytk/elfconv:arm64
# For x86-64 hosts
$ docker pull ghcr.io/yomaytk/elfconv:amd64
Build from Dockerfile:
$ git clone --recursive https://github.com/yomaytk/elfconv
$ cd elfconv
# For AArch64 ELF target
$ docker build . --build-arg ECV_AARCH64=1
# For x86-64 ELF target
$ docker build . --build-arg ECV_X86=1
For detailed build commands and environment variables, see scripts/README.md.
# 1. Run container with port forwarding
$ docker run -it -p 8080:8080 <image-name>
# 2. Convert ELF to Wasm
~/elfconv# cd bin
~/elfconv/bin# TARGET=aarch64-wasm INITWASM=1 ./exe.sh /path/to/ELF
# Example: TARGET=aarch64-wasm INITWASM=1 ./exe.sh ../examples/hello/c/a.aarch64
# 3. Start web server
~/elfconv/bin# emrun --no_browser --port 8080 <ELFNAME>.html
Access the Wasm application from your browser at http://localhost:8080/<ELFNAME>.html
# 1. Run container
$ docker run -it <image-name>
# 2. Convert ELF to Wasm
~/elfconv# cd bin
~/elfconv/bin# TARGET=aarch64-wasi32 ./exe.sh /path/to/ELF
# Example: TARGET=aarch64-wasi32 ./exe.sh ../examples/hello/c/a.aarch64
# 3. Execute with WasmEdge (preinstalled)
~/elfconv/bin# wasmedge <ELFNAME>.wasm
We'd love your help making it better!
runtime/syscalls/For questions or discussions, feel free to open an issue or start a discussion.
elfconv uses or references some projects as follows. Great thanks to all its developers!
./backend/remill and is modified for using from front-end and supporting additional instructions.browser/js-kernel.js is derived from code generated by Emscripten (MIT licensed).(top 24 of 50)
1,853 followers · starred Jan 2024
828 followers · starred Mar 2026
3,911 followers · starred Mar 2025
556 followers · starred Apr 2025