The Mucc C Compiler
Mucc is a small, fast, self-hosting C compiler toolchain for x86-64 and ARM64 Linux. The compiler, preprocessor, assembler, linker, archiver, headers and C library are one static file of a few megabytes. Copy it onto any 64-bit Linux machine, an empty container or a USB stick, and it builds working C programs with nothing else installed: no gcc, no binutils, no system headers.
curl -Lo mucc https://github.com/Dom-Yan/Mucc/releases/latest/download/mucc-$(uname -m)-linux
chmod +x mucc
./mucc -o hello hello.c && ./hello
Getting Started
Install mucc, build your first program, make it your default compiler, or build it from source.
User Guide
Compiling and linking, the two C libraries, cross-compiling, libraries, assembly and debugging.
Command-Line Reference
Every option mucc acts on, and the gcc flags it accepts.
C Language Support
C17 and C23, the GNU extensions, builtins, and what mucc does not do.
Performance
How fast mucc compiles next to gcc, clang and tcc, and how fast its code runs.
How Mucc Works
The pipeline, the single binary and its packed files, and how mucc builds itself.
News¶
- October 27, 2026: Mucc 1.4.1
compiles
sqlite3.c1.6 times as fast as 1.4.0, makes code as fast asgcc -O0's, and is 2.8 MB instead of 8.8, with its headers and C library compressed inside it. It closes 17 reported issues, andmake fuzztests it with random programs for as long as you let it run. See the changelog. - October 14, 2026: Mucc 1.4.0
runs on and makes programs for 64-bit ARM Linux (the Raspberry Pi 4 and
5, Asahi Linux, ARM servers) as well as x86-64, natively or with
--target=, starts several times faster, and fixes the bugs a deep review found. - October 8, 2026: Mucc 1.3.0
fixes every wrong-code bug, the crash and the rejected valid code an
outside test of 1.2.1 found, and needs no system
asorldfor-Xlinkeror for assembly that uses GNU as's common directives. - Mucc 1.2.1 was the first release built by mucc alone.
What Makes Mucc Different¶
- One file is the whole toolchain. Most compilers need a separate
assembler and linker (binutils), and the system's C library and
headers. Mucc carries its own of each: its assembler, its linker, its
archiver (
mucc -ar), musl, and musl's and Linux's headers, compressed inside the binary and read from memory. - Programs that run anywhere. By default it links statically against its own musl, so what it builds runs on any Linux for that CPU, old or new, glibc or not.
- Fully self-hosted. Each release is compiled, assembled and linked by the one before it, with gcc and binutils made to fail so nothing else can take part, and it rebuilds itself to the same bytes. No other compiler is needed, ever, to build or use mucc.
- Fast to compile. Several times faster
than
gcc -O0, and faster thanclang -O0. - Two CPUs, either way. It runs on x86-64 and ARM64 and makes
programs for both:
--target=aarch64-linuxon an x86-64 machine, or the other way round. - Small enough to read. A few tens of thousands of lines of C, one file or a few per stage, split into sections, that one person can read from end to end.
- Real C, for real programs. C17 by default, C23 with
-std=c23, and the GNU extensions real code uses. SQLite, Lua, Redis, Tcl, jq, zlib, Git, libpng, QuickJS and TinyCC build with it and pass their own test suites, and CPython passes nearly all of its. - A drop-in for gcc. It takes gcc's flags, so Makefiles and
configurescripts work unchanged. Like clang, it says it is gcc 4.2. - Debuggable.
-gwrites DWARF that gdb understands, and errors point at the line and column like gcc's.
At a Glance¶
| Compile speed | Several times faster than gcc -O0, and faster than clang -O0 (the numbers) |
|---|---|
| Generated code | In the range of gcc -O0's; slower than gcc -O2's |
| Size | One static binary of a few megabytes, with musl and Linux's headers inside (what's in it) |
| Language | C17 by default, C23 with -std=c23, plus the GNU extensions real code uses |
| Targets | x86-64 and ARM64 (AArch64) Linux, natively or cross-compiling either way |
| Self-hosting | Each release is built by the one before it, with no gcc or binutils, and rebuilds itself byte for byte |
| License | The Mucc License: free for any use; programs you build with mucc are yours alone (details) |
What It Doesn't Do¶
Use gcc or clang if you need any of these:
- Platforms other than 64-bit Intel, AMD or ARM Linux (on Windows, use WSL 2).
- Optimization beyond register allocation and constant folding: its
code is in the range of
gcc -O0's. - C++. Mucc compiles C only.
- Shared libraries and
dlopenwith the bundled musl: use--libc=systemfor those. - Sanitizers, coverage or profiling.
C Language Support has the full list.
Links¶
- The git repository, with the releases and the changelog
- chibicc, the small C compiler mucc grew from
- musl, the C library inside mucc
- TinyCC, the Tiny C Compiler
- GCC, Clang and the LLVM Compiler Infrastructure, whose documentation this site's look follows