GitHub|Download|Report a bug Mucc Home|Documentation»FAQ and Problems

Frequently Asked Questions

General

Is mucc a replacement for gcc or clang?

For compiling and building C quickly, with nothing installed, yes: it takes their flags and builds real programs. For the fastest code, C++, sanitizers or other platforms, use gcc or clang. Many people use both: mucc while developing, gcc -O2 for release builds.

Does it output C?

No: mucc compiles C into native x86-64 and ARM64 Linux programs, object files and libraries, the same kinds of files gcc makes. -S shows the assembly it generates.

Do the programs it builds need mucc to run?

No. By default they are static executables with musl inside, and run on any Linux for their CPU. With --libc=system they use the system's glibc, like gcc's programs.

Which version of C should I write?

C17, the default, is the safest choice: it is what most compilers and code target. Use -std=c23 for C23's features. See C Language Support.

Why is it so small?

It is one program with no optimizer, and its headers and C library are compressed inside it (see The Single Binary).

Can I use Mucc's code in my own project?

Yes, for any purpose, under the Mucc License: keep the license and each file's notice, credit “Based on Mucc by Dom-Yan”, keep “Mucc” in the name of a compiler made from it, and never present it as your own, even rewritten by an AI tool. Programs you only compile with mucc carry no conditions. See License.

Common Problems

mucc: command not found

Open a new terminal, or add export PATH="$HOME/.local/bin:$PATH" to your ~/.bashrc.

A library like OpenSSL or SDL isn't found

The bundled musl only links static libraries built for it. Use the system's libraries with --libc=system, which needs glibc's development files (build-essential) and the library's (libssl-dev, ...).

An unknown option is an error

Mucc accepts and ignores flags that only tune optimization or diagnostics, but an option it doesn't know at all is an error, so nothing is silently wrong. Please report it if gcc takes it.

A program uses _BitInt, nested functions, AVX or C++

Mucc doesn't support those (see What Mucc Does Not Support). Code that checks for AVX or NEON with __AVX__ or __ARM_NEON takes its portable path.

Building on WSL 2 is slow

Clone into your Linux home (~), not /mnt/c.

cc: not found when building mucc

There is no C compiler: build with make CC=mucc, or install gcc.

The code mucc makes is slower than gcc's

It is in the range of gcc -O0's, slower than gcc -O2's (see Performance). With the bundled musl, malloc and stdio are slower than glibc's too; --libc=system uses glibc's.

Getting Help

Ask or report on the issue tracker.