0c, 1c, 2c, 5c, 6c, 7c, 8c, 9c, kc, qc, vc – C compilers|
8c [ option ... ] [ file ... ]|
These commands compile the named C files into object files for
the corresponding architecture. If there are multiple C files,
the compilers will attempt to keep $NPROC compilations running
concurrently. Associated with each compiler is a string objtype,
0c spim little–endian MIPS 3000 family
1c 68000 Motorola MC68000
2c 68020 Motorola MC68020
5c arm little–endian ARM
6c amd64 AMD64 and compatibles (e.g., Intel64)
7c alpha Digital Alpha APX
8c 386 Intel i386, i486, Pentium, etc.
9c power6464–bit PowerPC
kc sparc Sun (now Oracle) SPARC
qc power PowerPC
vc mips big–endian MIPS 3000 family
–o obj Place output in file obj (allowed only if there is just one input file). Default is to take the last element of the input file name, strip any trailing .c, and append .O.
–w Print warning messages about unused variables, etc.
–W Similar to –w, but makes warnings into errors, so that large builds that should be warning–free will stop in their tracks.
–B Accept functions without a new–style ANSI C function prototype. By default, the compilers reject functions used without a defined prototype, although ANSI C permits them.
–DnameDefine the name to the preprocessor, as if by #define. If no definition is given, the name is defined as 1.
–F Enable type–checking of calls to print(2) and other formatted print routines. See the discussion of extensions, below.
–Idir An #include file whose name does not begin with slash or is enclosed in double quotes is always sought first in the directory of the file argument. If this fails, the –. flag is given or the name is enclosed in <>, it is then sought in directories named in –I options, then in /sys/include, and finally in
–N Suppress automatic registerization and optimization.
–S Print an assembly language version of the object code on standard output as well as generating the .O file.
–T Pass type signatures on all external and global entities. The signature is based on the C signof operator. See dynld(2).
–V By default, the compilers are non–standardly lax about type equality between void* values and other pointers; this flag requires ANSI C conformance.
–p Invoke a standard ANSI C preprocessor before compiling.
–a Instead of compiling, print on standard output acid functions (see acid(1)) for examining structures declared in the source files.
–aa Like –a except suppress information about structures declared in included header files.
–n When used with –a or –aa, places acid functions in file.acid for input file.c, and not on standard output.
– A structure or union may contain unnamed substructures and subunions. The fields of the substructures or subunions can then be used as if they were members of the parent structure or union. When names conflict, the outermost declaration is used. When a pointer to the outer structure or union is used in a
– A #pragma of the form
– The compilers accept long long variables as a 64–bit type. The standard header typedefs this to vlong. Arithmetic on vlong values is usually emulated by a run–time library, though in at least 8c, only division and modulus use the run–time library and the other operators generate in–line code (and uvlong–
For the 386, produce a program prog from C files main.c and sub.c:|
/sys/include system area for machine–independent #include directives.|
/$objtype/include system area for machine–dependent #include directives.
/sys/src/cmd/cc machine–independent part|
/sys/src/cmd/8c, etc. machine–dependent part
8a(1), 8l(1), cpp(1), mk(1), nm(1), pcc(1), db(1), acid(1)
The list of compilers given above is only partial, not all architectures
are supported on all systems, some have been retired and some
are provided by third parties.