GitHub|Download|Report a bug Mucc Home|Documentation»Command-Line Reference

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

OptionWhat it does
-o fileOutput file
-cCompile and assemble, don't link: one .o per input
-SStop after generating assembly
-EPreprocess only, to stdout (or -o)
-fsyntax-onlyCheck the code, write nothing
-x c, -x assembler, -x assembler-with-cpp, -x noneThe type of the inputs that follow

Preprocessor

OptionWhat it does
-I, -isystem, -iquote, -idirafter, -nostdincInclude directories
-D, -U, -include, -imacrosMacros
-dM -EPrint every macro defined at the end
-PWith -E, leave out the # line markers
-Wp,a,bPass options to the preprocessor
-M, -MM, -MD, -MMD, -MF, -MT, -MQ, -MP, -MGDependency files

Language

OptionWhat it does
-std=C standard: c89, c99, c11, c17 (the default), c23, and their gnu* forms
-funsigned-char, -fsigned-charWhether plain char is unsigned
-fno-builtin, -ffreestandingfabs, fabsf and fabsl are calls, not builtins
-fcommon, -fno-common, -fvisibility=Symbols

Warnings

OptionWhat it does
-Wall, -Wname, -Wno-nameTurn warnings on or off
-Werror, -Werror=nameMake warnings errors
-wNo warnings

Code Generation

OptionWhat it does
-g, -g0Debug info (DWARF) on or off
-fpic, -fPIC, -fno-pic, -fno-PICPosition-independent code
--target=, -targetBuild for x86-64 or ARM64 (any GNU triple)
-msse3 to -msse4.2, -maes, -mpclmul, -mpopcntDefine 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

OptionWhat it does
-Wa,a,b, -Xassembler aPass options to as. The built-in assembler takes none: it ignores --noexecstack, -g and --64 quietly and warns about others.
-fno-integrated-asUse the system's as (-fintegrated-as, the default, uses the built-in one)
-fno-as-fallbackNever use the system's as, even for what the built-in one doesn't know (-fas-fallback is the default)

Linking

OptionWhat it does
-L, -lLibrary directories and libraries
-static, -shared, -r, -sStatic or shared output, relocatable output, strip
-pthread, -rdynamicThreads, and exporting symbols for dlopened modules
-nostdlib, -nostartfiles, -nodefaultlibsLeave out the C library or the startup files
-Wl,a,b, -Xlinker aPass options to the linker
-fuse-ld=Use the system's ld, as -fuse-ld=bfd
--libc=mucc, --libc=systemWhich C library (see the User Guide)

Information

OptionWhat it does
--version, -dumpversion, -dumpfullversion, -dumpmachineVersion and target
--helpThe most used options, and a link to this page
-v, -###Show what mucc runs
-print-search-dirs, -print-file-name=, -print-prog-name=, -print-multiarchWhere mucc looks for things

Tools

As the first argument:

CommandWhat it does
mucc -arThe archiver, like GNU ar: r, q, d and t, with c, s, S, u, D and v
mucc -ranlibRewrite an archive's symbol index
mucc -packCompress the files the single binary carries (used by the build; see How Mucc Works)