CC(1) CC(1)
NAME
cc - MIPS C compiler
SYNOPSIS
cc [ option ] ... file ...
DESCRIPTION
Cc, the MIPS ucode C compiler, runs on MIPS machines under
UNIX System 4.3bsd and System V. It produces files in the
following formats: MIPS object code in MIPS extended coff(5)
format (the normal result), binary or symbolic ucode, ucode
object files and binary or symbolic assembly language. Cc
accepts several types of arguments:
Arguments whose names end with `.c' are assumed to be C
source programs. They are compiled, and each object program
is left in the file whose name consists of the last
component of the source with `.o' substituted for `.c'. The
`.o' file is only deleted when a single source program is
compiled and loaded all at once.
Arguments whose names end with `.s' are assumed to be
symbolic assembly language source programs. They are
assembled, producing a `.o' file.
If only ucode object files are to be produced (with the -j
flag) each C source file is compiled into a ucode object
file. The ucode object file is left in a the file whose name
consists of the last component of the source with `.u'
substituted for `.c'.
The suffixes described below primarily aid compiler
development and are not generally used. Arguments whose
names end with `.F', `.O', `.S', and `.M' are assumed to be
binary ucode, produced by the front end, optimizer, ucode
object file splitter and ucode merger respectively.
Arguments whose names end with `.U' are assumed to be
symbolic ucode. Arguments whose names end with `.G' are
assumed to be binary assembly language, which is produced by
the code generator and the symbolic to binary assembler.
Files that are assumed to be binary ucode, symbolic ucode,
or binary assembly language by the suffix conventions are
also assumed to have their corresponding symbol table in a
file with a `.T' suffix.
Cc always defines the C preprocessor macros mips, hostmips
and unix to the C macro preprocessor and defines the C
preprocessor macro LANGUAGEC when a `.c' file is being
compiled. Cc will define the C preprocessor macro
LANGUAGEASSEMBLY when a `.s' file is being compiled.
Page 1 (last mod. 8/20/87)
CC(1) CC(1)
If the environment variable TMPDIR is set, the value is used
as the directory for the temporary files. The default is
/tmp. TMPDIR should be used to avoid running out of space in
/tmp when compiling large programs.
The following options are interpreted by cc(1). See ld(1)
for load-time options.
-c Suppress the loading phase of the compilation and
force an object file to be produced even if only one
program is compiled.
-g0 Have the compiler produce no symbol table
information for symbolic debugging. This is the
default. This switch overrides the optimization
switches (-O, -O1, -O2, -O3).
-g1 Have the compiler produce additional symbol table
information for accurate but limited symbolic
debugging of partially optimized code. If loading
happens the debugging library (libdbx.a) is also
loaded. This switch overrides the optimization
switches (-O, -O1, -O2, -O3).
-g or -g2
Have the compiler produce additional symbol table
information for full symbolic debugging and not do
optimizations that limit full symbolic debugging.
If loading happens the debugging library (libdbx.a)
is also loaded. This switch overrides the
optimization switches (-O, -O1, -O2, -O3).
-g3 Have the compiler produce additional symbol table
information for full symbolic debugging for fully
optimized code. This option makes the debugger
inaccurate. If loading happens the debugging
library (libdbx.a) is also loaded. This switch can
be used in conjunction with the optimization
switches (-O, -O1, -O2, -O3).
-w Suppress warning messages.
-p0 Do not permit any profiling. This is only for
programs that must be as small as possible. If
loading happens, the standard runtime startup
routine (crt0.o) is used, no profiling library is
searched and the standard C library (libc.a) is
searched. This option is the default.
-p1 or -p
Set up for profiling by periodically sampling the
value of the program counter. This option only
Page 2 (last mod. 8/20/87)
CC(1) CC(1)
effects the loading. When loading happens, this
option replaces the standard runtime startup routine
with the profiling runtime startup routine (mcrt0.o)
and searches the level 1 profiling library
(libprof1.a) When profiling happens, the startup
routine calls monstartup(3) and produces a file
mon.out that contains execution-profiling data for
use with the postprocessor mprof(1).
-O0 Turn off all optimizations.
-O1 Turn on all optimizations that can be done quickly.
This is the default.
-O or -O2
Invoke the global ucode optimizer.
-O3 Do all optimizations, including global register
allocation. This option must precede all source
file arguments. With this option, a ucode object
file is created for each source file and left in a
`.u' file. These newly created ucode object files
and the ucode object files specified on the command
line are linked. Optimization is done on the
resulting file. This file is compiled and the
object file for it is left in `u.out.o' by default.
If -ko output is specified, the object file is left
in a file whose name consists of output with the
suffix changed to `.o' or a `.o' suffix is appended
to output if output has no suffix.
-Zq Time all subprocesses, and report these times on
stdout at the end of the compilation.
-Zg Load the program with the special files and
libraries necessary for IRIS graphics programs.
When this switch is used, the Graphics Library -lgl
and the appropriate math library are given by
default. Special files must be loaded for using
graphics with each source language. Hence, cc must
be able to determine the combination of languages
involved in the link step. If the compilation line
specified f77, or a FORTRAN source file (with the
extension .f), cc assumes that FORTRAN routines are
present. In this case, the program is also loaded
with the FORTRAN graphics interface library -lfgl .
If the compilation line specified pc, or a Pascal
source file (with the extension .p), cc assumes that
Pascal routines are present. The program is loaded
with the special Pascal routine /usr/lib/pzcstr.o.
-Zv Have the compiler produce warnings for things that
Page 3 (last mod. 8/20/87)
CC(1) CC(1)
are not standard in the language.
-ZG Load the program with IRIS-4D Series compatible
FORTRAN library routines getarg and iargc. This is
a temporary switch to facilitate ease of porting
FORTRAN code. You should change your FORTRAN code
to use the IRIS-4D Series default library routines
getarg and iargc.
-j Compile the specified source programs, and leave the
ucode object file output in corresponding files
suffixed with `.u'. Please note that this switch is
non-standard and may not be supported across product
lines.
-ko output
Name the output file created by the ucode loader as
output. This file is not removed. If this file is
compiled, the object file is left in a file whose
name consists of output with the suffix changed to a
`.o'. If output has no suffix, a `.o' suffix is
appended to output. Please note that this switch is
non-standard and may not be supported across product
lines.
-k Pass options that start with a -k to the ucode
loader. This option is used to specify ucode
libraries (with -klx ) and other ucode loader
options. Please note that this switch is non-
standard and may not be supported across product
lines.
-S Compile the specified source programs and leave the
symbolic assembly language output in corresponding
files suffixed with `.s'. If the -O3 option is
used, then a single file, u.out.s is produced.
-P Run only the C macro preprocessor and put the result
for each source file (by suffix convention, i.e.,
'.c' and '.s') in a corresponding `.i' file. The
`.i' file has no `#' lines in it.
-E Run only the C macro preprocessor files (regardless
of any suffix or not), and send the result to the
standard output.
-o output
Name the final output file output. If this option
is used, the file `a.out' is undisturbed.
-Dname=def
-Dname Define the name to the C macro preprocessor, as if
Page 4 (last mod. 8/20/87)
CC(1) CC(1)
by `#define'. If no definition is given, the name
is defined as "1".
-Uname Remove any initial definition of name.
-Idir `#include' files whose names do not begin with `/'
are always sought first in the directory of the file
argument, then in directories specified in -I
options, and finally in the standard directory
(/usr/include).
-I This option will cause `#include' files never to be
searched for in the standard directory
(/usr/include).
-G num Specify the maximum size, in bytes, of a data item
that is to be accessed from the global pointer. Num
is assumed to be a decimal number. If num is zero,
no data is accessed from the global pointer. The
default value for num is 512 bytes. Data stored off
of the global pointer can be accessed by the program
quickly, but this space is limited. Large programs
may overflow the space accessed by the global
pointer at load time. If the loader gives the error
message ``Bad -G num value'', recompile with a
smaller -G num value (-G 8 or lower). Please note
that this switch is non-standard and may not be
supported across product lines.
-v Print the passes as they execute with their
arguments and their input and output files. Also
prints resource usage in the C-shell time format on
UNIX 4.3bsd systems.
-V Print the version of the driver and the versions of
all passes. This is done with the what(1) command.
Please note that this switch is non-standard and may
not be supported across product lines.
-cpp Run the C macro preprocessor on C and assembly
source files before compiling. This is the default.
-nocpp Do not run the C macro preprocessor on C and
assembly source files before compiling.
The following options are specific to cc:
-signed
Cause all char declarations to be signed char
declarations, the default is to treat them as unsigned
char declarations.
Page 5 (last mod. 8/20/87)
CC(1) CC(1)
-volatile
Causes all variables to be treated as volatile.
-varargs
Prints warnings for lines that may require the
varargs.h macros. Please note that this switch is
non-standard and may not be supported across product
lines.
-float
Cause the compiler to never promote expressions of type
float to type double .
The options described below primarily aid compiler
development and are not generally used:
-Hc Halt compiling after the pass specified by the
character c, producing an intermediate file for the
next pass. The c can be [ fjusmoca ]. It selects the
compiler pass in the same way as the -t option. If
this option is used, the symbol table file produced and
used by the passes, is the last component of the source
file with the suffix changed to `.T' and is not
removed. Please note that this switch is non-standard
and may not be supported across product lines.
-K Build and use intermediate file names with the last
component of the source file's name replacing its
suffix with the conventional suffix for the type of
file (for example `.F' file for binary ucode, produced
by the front end). These intermediate files are never
removed even when a pass encounters a fatal error.
Please note that this switch is non-standard and may
not be supported across product lines.
-# Converts binary ucode files (`.F') or optimized binary
ucode files (`.O') to symbolic ucode (a `.U' file)
using btou(1). If a symbolic ucode file is to be
produced by converting the binary ucode from the C
compiler front end then the front end option -Xu is
used instead of btou(1). Please note that this switch
is non-standard and may not be supported across product
lines.
-Wc,arg1[,arg2...]
Pass the argument[s] argi to the compiler pass c. The c
is one of [ pfjusmocabl ]. The c selects the compiler
pass in the same way as the -t option.
The options -t[hpfjusmocablrindt], -hpath, and -Bstring
select a name to use for a particular pass, startup routine,
or standard library. These arguments are processed from
Page 6 (last mod. 8/20/87)
CC(1) CC(1)
left to right so their order is significant. When the -B
option is encountered, the selection of names takes place
using the last -h and -t options. Therefore, the -B option
is always required when using -h or -t. Sets of these
options can be used to select any combination of names.
Any of the -p[01] options and any of the -g[0123] options
must precede all -B options because they can affect the
location of runtimes and what runtimes are used.
-t[hpfjusmocablrindt]
Select the names. The names selected are those
designated by the characters following the -t option
according to the following table:
Name Character
include h
cpp p
ccom f
ujoin j
uld u
usplit s
umerge m
uopt o
ugen c
as0 a
as1 b
ld l
[m]crt0.o r
libc.{a,b} i
libprofn.a n
libdbx.a d
btou, utob t
-hpath
Use path rather than the directory where the name is
normally found. Please note that this switch is non-
standard and may not be supported across product lines.
-Bstring
Append string to all names specified by the -t option.
If no -t option has been processed before the -B, the
-t option is assumed to be ``hpfjusmocablrindt''. This
list designates all names.
If no -t argument has been processed before the -B then a
-Bstring is passed to the loader to use with it's -lx
arguments.
Invoking the compiler with a name of the form ccstring has
the same effect as using a -Bstring option on the command
line.
Page 7 (last mod. 8/20/87)
CC(1) CC(1)
Other arguments are assumed to be either loader options or
C-compatible object files, typically produced by an earlier
cc run, or perhaps libraries of C-compatible routines.
These files, together with the results of any compilations
specified, are loaded in the order given, producing an
executable program with the default name a.out.
FILES
file.c input file
file.o object file
a.out loaded output
/tmp/ctm? temporary
/usr/lib/cpp C macro preprocessor
/usr/lib/ccom C front end
/usr/lib/ujoin binary ucode and symbol table joiner
/usr/bin/uld ucode loader
/usr/lib/usplit binary ucode and symbol table splitter
/usr/lib/umerge procedure intergrator
/usr/lib/uopt optional global ucode optimizer
/usr/lib/ugen code generator
/usr/lib/as0 symbolic to binary assembly language
translator
/usr/lib/as1 binary assembly language assembler and
reorganizer
/usr/lib/crt0.o runtime startup
/usr/lib/mcrt0.o startup for profiling
/usr/lib/libc.a standard library, see intro(3)
/usr/lib/libprof.1a level 1 profiling library
/usr/lib/libdbx.a debugging library
/usr/include standard directory for `#include' files
/usr/bin/ld MIPS loader
mon.out file produced for analysis by prof(1)
SEE ALSO
B. W. Kernighan and D. M. Ritchie, The C Programming
Language, Prentice-Hall, 1978
B. W. Kernighan, Programming in C-a tutorial
D. M. Ritchie, C Reference Manual
monstartup(3), prof(1), ld(1), dbx(1), what(1), pixie(1).
DIAGNOSTICS
The diagnostics produced by cc are intended to be self-
explanatory. Occasional messages may be produced by the
assembler or loader.
ORIGIN
MIPS Computer Systems
Page 8 (last mod. 8/20/87)