Command-Line Reference
The options mucc acts on. Other gcc flags that only tune optimization,
diagnostics or hardening (-O2, -fstack-protector,
-flto, -pipe, ...) are accepted and ignored, so
build scripts that pass them work. An unknown flag is an error.
Output¶
| Option | What it does |
-o file | Output file |
-c | Compile and assemble, don't link: one .o per input |
-S | Stop after generating assembly |
-E | Preprocess only, to stdout (or -o) |
-fsyntax-only | Check the code, write nothing |
-x c, -x assembler, -x assembler-with-cpp, -x none | The type of the inputs that follow |
Preprocessor¶
| Option | What it does |
-I, -isystem, -iquote, -idirafter, -nostdinc | Include directories |
-D, -U, -include, -imacros | Macros |
-dM -E | Print every macro defined at the end |
-P | With -E, leave out the # line markers |
-Wp,a,b | Pass options to the preprocessor |
-M, -MM, -MD, -MMD, -MF, -MT, -MQ, -MP, -MG | Dependency files |
Language¶
| Option | What it does |
-std= | C standard: c89, c99, c11, c17 (the default), c23, and their gnu* forms |
-funsigned-char, -fsigned-char | Whether plain char is unsigned |
-fno-builtin, -ffreestanding | fabs, fabsf and fabsl are calls, not builtins |
-fcommon, -fno-common, -fvisibility= | Symbols |
Warnings¶
| Option | What it does |
-Wall, -Wname, -Wno-name | Turn warnings on or off |
-Werror, -Werror=name | Make warnings errors |
-w | No warnings |
Code Generation¶
| Option | What it does |
-g, -g0 | Debug info (DWARF) on or off |
-fpic, -fPIC, -fno-pic, -fno-PIC | Position-independent code |
--target=, -target | Build for x86-64 or ARM64 (any GNU triple) |
-msse3 to -msse4.2, -maes, -mpclmul, -mpopcnt | Define gcc's macros for these extensions (__SSE4_2__ and those before it, ...), so code takes its paths for them. The code mucc makes doesn't change. |
-march=, -mtune=, -mcpu= | Accepted, and change nothing: mucc only emits instructions every x86-64 (or ARMv8-A) CPU has, -march=native included |
Assembler¶
| Option | What it does |
-Wa,a,b, -Xassembler a | Pass options to as. The built-in assembler takes none: it ignores --noexecstack, -g and --64 quietly and warns about others. |
-fno-integrated-as | Use the system's as (-fintegrated-as, the default, uses the built-in one) |
-fno-as-fallback | Never use the system's as, even for what the built-in one doesn't know (-fas-fallback is the default) |
Linking¶
| Option | What it does |
-L, -l | Library directories and libraries |
-static, -shared, -r, -s | Static or shared output, relocatable output, strip |
-pthread, -rdynamic | Threads, and exporting symbols for dlopened modules |
-nostdlib, -nostartfiles, -nodefaultlibs | Leave out the C library or the startup files |
-Wl,a,b, -Xlinker a | Pass options to the linker |
-fuse-ld= | Use the system's ld, as -fuse-ld=bfd |
--libc=mucc, --libc=system | Which C library (see the User Guide) |
| Option | What it does |
--version, -dumpversion, -dumpfullversion, -dumpmachine | Version and target |
--help | The most used options, and a link to this page |
-v, -### | Show what mucc runs |
-print-search-dirs, -print-file-name=, -print-prog-name=, -print-multiarch | Where mucc looks for things |
As the first argument:
| Command | What it does |
mucc -ar | The archiver, like GNU ar: r, q, d and t, with c, s, S, u, D and v |
mucc -ranlib | Rewrite an archive's symbol index |
mucc -pack | Compress the files the single binary carries (used by the build; see How Mucc Works) |