CCOM(1)
π NAME π
ccom β the C compiler. like, the actual compiler compiler. section 1 of the General Commands Manual, CCOM(1), bestie. π
β¨ SYNOPSIS β¨
ccom [-gkpsv] [-f features] [-m options] [-W warnings] [-X flags]
[-x settings] [-Z flags] [infile] [outfile]
πΈ DESCRIPTION πΈ
okay so. ccom is a C compiler, periodt. the frontend you actually talk to is usually pcc(1), which meansβ¦
β οΈ ccom is not intended to be run directly. it's the backstage queen, not the one you dm. respect the pipeline. π
what it does: it reads your C source from infile (or from standard input if you didn't hand it one) and writes the assembler source to outfile (or to standard output if you didn't hand it one). that's the vibe. in goes C, out goes assembly. π¦
The options are as follows:
π OPTIONS π
-ffeature β turn on language features. you can stack multiple-foptions, and these are the features that exist:stack-protectorβ Enable stack smashing protection. Currently the same asstack-protector-all.stack-protector-allβ Enable stack smashing protection for all functions. all of them. every single one. no exceptions. πpack-struct[=n]β Specify maximum alignment for structure members, similar to a#pragma packstatement at the start of the file. If no value is given, the default is1.freestandingβ Emit code for a freestanding environment. Currently not implemented (it's giving "coming soon" energy, don't count on it).
-gβ Include debugging information in the output code for use by symbolic and source-level debuggers. Currently this uses thestabsformat, encoding information in symbol table entries. yes,stabs. it's the format's name, not a threat. πͺ-kβ Generate PIC code. position-independent, main character energy. β¨-moption β target-specific options, used in machine-dependent code. you can stack multiple-moptions. here's the full roster of targets and what they take:- AMD64 β (no
-moptions listed for this one) - ARM β
little-endian,big-endian,fpe=fpa,fpe=vpf,soft-float,arch=armv1,arch=armv2,arch=armv2a,arch=armv3,arch=armv4,arch=armv4t,arch=armv4tej,arch=armv5,arch=armv5te,arch=armv5tej,arch=armv6,arch=armv6t2,arch=armv6kz,arch=armv6k&arch=armv7. it's a whole buffet. π - HPPA β (no
-moptions listed for this one) - i386 β (no
-moptions listed for this one) - M16C β (no
-moptions listed for this one) - MIPS β
little-endian&big-endian. - NOVA β (no
-moptions listed for this one) - PDP-10 β (no
-moptions listed for this one) - PDP-11 β (no
-moptions listed for this one) - PowerPC β
little-endian,big-endian,soft-float&hard-float. - Sparc64 β (no
-moptions listed for this one) - VAX β (no
-moptions listed for this one)
- AMD64 β (no
-pβ Generate profiling code. so you can find out where your program spends all its time (spoiler: it's the same function as always). π₯-sβ Print statistics to standard error when complete. and bestie, it prints everything: name table entries, name string size, permanent allocated memory, temporary allocated memory, lost memory, argument list unions, dimension/function unions, struct/union/enum blocks, inline node count, inline control blocks, and permanent symtab entries. a full receipts moment. π§Ύ-vβ Display version. short, sweet, iconic.-Wwarning β Do some basic checks and emit warnings about possible coding problems. you can stack multiple-Woptions, and here's what's supported:error[=warning]β Enable warning, and treat it as an error condition. If a specific warning is not given, producing any warning will cause an error. πattributesβ Warn when unsupported attributes are used. This warning is enabled by default.deprecated-declarationsβ Report whenever a symbol marked with the βdeprecatedβ attribute is used. This warning is enabled by default.implicit-function-declarationβ (TODO) Require explicit prototypes for all called functions.implicit-intβ (TODO) Warn when a function declaration lacks a type.missing-prototypesβ Require explicit prototypes for all global function definitions.pointer-signβ Warn when pointer operations are done with mismatched signed and unsigned values.sign-compareβ (TODO) Warn about comparisons between signed and unsigned values.strict-prototypesβ (TODO) Require that function prototypes are strictly C99.shadowβ Report when a local variable shadows something from a higher scope. π» (yes, that's why it's called that, no cap)truncateβ Report when integer values may be implicitly truncated to fit a smaller type.uninitializedβ A variable is read before being written.unknown-pragmasβ Report unhandled pragma statements.unreachable-codeβ Report statements that cannot be executed.
π‘ any of the above may be prefixed with βno-β in order to disable the effect. sono-shadow,no-uninitialized, whatever you need. slay.
-Xflags β C specific debugging, where flags is one or more of the following:bβ Building of parse treesdβ Declarations (using multipledflags gives more output β moreds, more drama π)eβ Pass1 trees at exitiβ Initializationsnβ Memory allocationsoβ Turn off optimisationspβ Prototypessβ Inliningtβ Type conversionsxβ Target-specific flag, used in machine-dependent code
-xsetting β Enable setting in the compiler. you can stack multiple-xoptions, and these are the settings on the menu:ccpβ Apply sparse conditional constant propagation techniques for optimization. Currently not implemented.dceβ Do dead code elimination. bye bestie, you're not even reachable. πdeljumpsβ Delete redundant jumps and dead code.gnu89β the manpage gives this one no blurb. we love an enigma. β¨gnu99β Use GNU C semantics rather than C99 for some things. Currently onlyinline.inlineβ Replace calls to functions marked with aninlinespecifier with a copy of the actual function.ssaβ Convert statements into static single assignment form for optimization. Not yet finished.tailcallβ Enable optimization of tail-recursion functions. Currently not implemented.tempsβ Locate automatic variables into registers where possible, for further optimization by the register allocator.ucharβ Treat character constants as unsigned values.
-Zflags β Code generator (pass2) specific debugging, where flags is one or more of the following:bβ Basic block and SSA buildingcβ Code printouteβ Trees when entering pass2fβ Instruction matcher, may provide much output (it's giving verbose π£οΈ)gβ Print flow graphsnβ Memory allocationoβ Instruction generatorrβ Register allocatorsβ Shape matching in instruction generatortβ Type matching in instruction generatoruβ Sethi-Ullman computationsxβ Target-specific flag, used in machine-dependent code
β¨ PRAGMAS β¨
okay bestie, listen, this is the part where you get to talk back to the compiler mid-compile. iconic behaviour, honestly. π
Input lines starting with a #pragma directive can be used to modify behaviour of ccom during compilation. Every token up to the first unescaped newline counts as part of the pragma command, and these are the operations it recognises:
STDCβ a Standard C99 operator follows. Currently no C99 operations are implemented, and any directives starting with this token will be silently ignored. (she's giving ghosting, and honestly? fair) π»GCC diagnostic effect "option"β GNU C compatibility. This one alters the effects of compiler diagnostics. The required effect should be stated aswarning,errororignored, followed by the compiler diagnostic option in double quotes. So, for example, to force unknown pragmas to always generate an error, a standard header might include:
#pragma GCC diagnostic error "-Wunknown-pragmas"
GCC poison identifier ...β GNU C compatibility. Cause an error if any of the following identifiers subsequently appear in the code (but not in any macro expansions). Currently not implemented.GCC system_headerβ GNU C compatibility. Currently not implemented.GCC visibilityβ GNU C compatibility. Currently not implemented.pack([n])β Set the default maximum alignment for structures and unions, such that members will have their natural alignment requirements clamped at this value and may be stored misaligned. Ifnis not given, the alignment is reset to the target default. squish those structs, slay π«Άpack(push[, n])β Push the current pack setting onto an internal stack then, ifnis given, change the default alignment for structures and unions. Currently not implemented.pack(pop)β Change the pack setting to the most recently pushed value, and remove that setting from the stack. Currently not implemented.packed [n]β Set the maximum alignment for the structure or union defined in the current statement. Ifnis not given, the default value of1is used. (Currently this works exceptnis not used β so like, it shows up to the party but doesn't do anything π)aligned [n]β Set the minimum alignment for the structure or union defined in the current statement.rename nameβ Provide an alternative name which will be used to reference the object declared in the current statement. glow-up via rebrand, we love to see it β¨weak name[=alias]β Mark name as a weak rather than a global symbol, to allow its definition to be overridden at link time. If an alias is given, this will be used as the default value of name.identβ Currently not implemented.
and the following target-specific operations are handled by machine-dependent code:
tlsβ For AMD64 and i386 targets, the variable declared in the current statement will be referenced via the βthread-local storageβ mechanism.initβ For AMD64, ARM, HPPA, i386, MIPS and PowerPC targets, when the current statement is a function declaration, generate a reference in the.ctorssection, enabling library code to call the function prior to enteringmain().finiβ For AMD64, ARM, HPPA, i386, MIPS and PowerPC targets, when the current statement is a function declaration, generate a reference in the.dtorssection, enabling library code to call the function whenmain()returns or theexit()function is called.section nameβ For AMD64, ARM, HPPA and i386 targets, place the subsequent code in the named section. (This is currently broken). πalias nameβ For AMD64, HPPA and i386 targets, emit assembler instructions providing an alias for the symbol defined by the current statement.stdcallβ For i386 targets, enable βstdcallβ semantics during code generation, where function arguments are passed on the stack in right-to-left order, and the callee is responsible for adjusting the stack pointer before returning. Any function result is passed in theEAXregister. On win32, the function name is postfixed with an β@β and the size of the stack adjustment.cdeclβ For i386 targets, enable βcdeclβ semantics during code generation, where function arguments are passed on the stack in right-to-left order, and the caller is responsible for cleaning up the stack after the function returns. Any function result is passed in theEAXregister. This is the default. she's the main character, the blueprint, the moment πfastcallβ For i386-win32 targets, enable βfastcallβ semantics during code generation. (Currently this is equivalent tostdcall, which is likely wrong).dllimportβ For i386-win32 targets, references to the external symbol defined by the current statement will be made via indirect access through a location identified by the symbol name prefixed with__imp_.dllexportβ For i386-win32 targets, the external symbol declared by the current statement will be exported as an indirect reference to be accessed withdllimport. The global locator will be the symbol name prefixed with__imp_. Currently this is not completely implemented.
Any unknown #pragma directives will be ignored unless the -Wunknown-pragmas diagnostic is in effect.
π SEE ALSO π
go read those too bestie, expanding your horizons fr fr π
π HISTORY π
The ccom compiler is based on the original Portable C Compiler by S. C. Johnson, written in the late 70's. Even though much of the compiler has been rewritten (about 50% of the frontend code and 80% of the backend), some of the basics still remain. Most is written by Anders Magnusson, with the exception of the data-flow analysis part and the SSA conversion code which is written by Peter A Jonsson, and the Mips port that were written as part of a project by undergraduate students at Lulea University of Technology.
This product includes software developed or owned by Caldera International, Inc.
and that's the whole page, bestie!! π this one came from Debian, dated March 22, 2012 β so like, a vintage icon, honestly. no cap, she's been serving since the 70's and she's still compiling. periodt. πβ¨
π¦ where this page comes from
- debian bookworm: pcc 1.2.0~DEVEL+20220331-1 Β· BSD-2-Clause
- debian trixie: pcc 1.2.0~DEVEL+20220331-1 Β· BSD-2-Clause
- ubuntu jammy: pcc 1.2.0~DEVEL+20200630-2 Β· BSD-2-Clause
- ubuntu noble: pcc 1.2.0~DEVEL+20220331-1 Β· BSD-2-Clause
- ubuntu questing: pcc 1.2.0~DEVEL+20220331-2
- ubuntu resolute: pcc 1.2.0~DEVEL+20220331-2build1 Β· BSD-2-Clause
- ubuntu stonking: pcc 1.2.0~DEVEL+20220331-2build1 Β· BSD-2-Clause
- Copyright (c) 2007 Jeremy C. Reed <reed@reedmedia.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms