Name
rcc - AT&T C compiler
Syntax
rcc [ options ] files
Description
The rcc command invokes the AT&T C compiler. Note that this
is a different compiler frm the Microsoft C compiler that is
available through cc(CP).
The AT&T compilation tools consist of a preprocessor,
compiler, optimizer, assembler, and link editor. The rcc
command processes the supplied options and then executes the
various tools with the proper arguments. The rcc command
accepts several types of files as arguments.
Files whose names end with .c are taken to be C source
programs and may be preprocessed, compiled, optimized,
assembled, and link edited. The compilation process may be
stopped after the completion of any pass if the appropriate
options are supplied. If the compilation process runs
through the assembler, then an object program is produced
and is left in the file whose name is that of the source
with .o substituted for .c. However, the .o file is
normally deleted if a single C program is compiled and then
immediately link edited. In the same way, files whose names
end in .s are taken to be assembly source programs and may
be assembled and link edited; and files whose names end in
.i are taken to be preprocessed C source programs and may be
compiled, optimized, assembled, and link edited. Files
whose names do not end in .c, .s, or .i are handed to the
link editor.
Since the rcc command usually creates files in the current
directory during the compilation process, it is necessary to
run the rcc command in a directory in which a file can be
created.
The following options are interpreted by rcc:
-c Suppress the link editing phase of the compilation and
do not remove any produced object files.
-ds Do not generate symbol attribute information for the
symbolic debugger.
-dl Do not generate symbolic debugging line number
information. This and the above flag may be used in
conjunction as -dsl (-dsl is the default unless the -g
flag is given).
-g Cause the compiler to generate additional information
needed for the use of sdb(CP).
-o outfile
Produce an output object file by the name outfile. The
name of the default file is a.out. This is a link
editor option.
-p Arrange for the compiler to produce code that counts
the number of times each routine is called; also, if
link editing takes place, profiled versions of libc.a
and libm.a (with -lm option) are linked and monitor(S)
is automatically called. A mon.out file will then be
produced at normal termination of execution of the
object program. An execution profile can then be
generated by use of prof(CP).
-qp Arrange for profiled code to be produced where the p
argument produces identical results to the -p option
[allows profiling with prof(CP)].
-E Run only cpp(CP) on the named C programs, and send the
result to the standard output.
-H Print out on stderr the path name of each file included
during the current compilation.
-O Do compilation phase optimization. This option will not
have any effect on .s files.
-P Run only cpp(CP) on the named C programs and leave the
result in corresponding files suffixed .i. This option
is passed to cpp(CP).
-S Compile and do not assemble the named C programs, and
leave the assembler-language output in corresponding
files suffixed .s.
-V Print the version of the compiler, optimizer, assembler
and/or link editor that is invoked.
-Wc,arg1[,arg2...]
Hand off the argument[s] argi to pass c where c is one
of [p02al] indicating the preprocessor, compiler,
optimizer, assembler, or link editor, respectively.
For example: -Wa,-m passes -m to the assembler.
-Y [p02alSILU],dirname
Specify a new path name, dirname, for the locations of
the tools and directories designated in the first
argument. [p02alSILU] represents:
p preprocessor
0 compiler
2 optimizer
a assembler
l link editor
S directory containing the start-up routines
I default include directory searched by cpp(CP)
L first default library directory searched by ld(CP)
U second default library directory searched by ld(CP)
If the location of a tool is being specified, then the
new path name for the tool will be dirname/tool. If
more than one -Y option is applied to any one tool or
directory, then the last occurrence holds.
-Zp[1|2|4]
Packs structure members in memory. Normally, structure
members are aligned as follows: items of type char are
byte-aligned, items of type short are aligned on two-
byte boundaries, and all other types of structure
members are word-aligned.
Specifying an option to -Zp will force alignment on the
given byte boundary. If no option is used with -Zp,
structure members will be packed on one-byte
boundaries. The alignment may be altered with the
#pragma pack preprocessor directive.
The rcc command also recognizes -C, -D, -I, and -U and
passes these options and their arguments directly to the
preprocessor without using the -W option. Similarly, the rcc
command recognizes -a, -l, -m, -r, -s, -t, -u, -x, -z, -L,
-M, and -V and passes these options and their arguments
directly to the loader. See the manual pages for cpp(CP)
and ld(CP) for descriptions.
Other arguments are taken to be C compatible object
programs, typically produced by an earlier rcc run, or
perhaps libraries of C compatible routines and are passed
directly to the link editor. These programs, together with
the results of any compilations specified, are link edited
(in the order given) to produce an executable program with
name a.out unless the -o option of the link editor is used.
If the rcc command is put in a file prefixcc the prefix will
be parsed off the command and used to call the tools, i.e.,
prefixtool. For example, OLDrcc will call OLDcpp, OLDcomp,
OLDoptim, OLDas, and OLDld and will link OLDcrt1.o.
Therefore, one MUST be careful when moving the rcc command
around. The prefix will apply to the preprocessor, compiler,
optimizer, assembler, link editor, and the start-up
routines.
The C language standard was extended to allow arbitrary
length variable names. The option pair ``-Wp,-T -W0,-XT''
will cause rcc to truncate arbitrary length variable names.
Files
file.c C source file
file.i preprocessed C source file
file.o object file
file.s assembly language file
a.out link edited output
LIBDIR/*rcrt1.o start-up routine
LIBDIR/rcrtn.o start-up routine
TMPDIR/* temporary files
LIBDIR/rcpp preprocessor, cpp(CP)
LIBDIR/rcomp compiler
LIBDIR/roptim optimizer
BINDIR/as assembler, as(CP)
BINDIR/ld link editor, ld(CP)
LIBDIR/ standard C library
LIBDIR/libc_s.a standard C shared library
LIBDIR is usually /lib.
BINDIR is usually /bin.
TMPDIR is usually /usr/tmp but can be redefined by setting
the environment variable TMPDIR [see tempnam() in
tmpnam(3S)].
See Also
as(CP), ld(CP), cpp(CP), gencc(CP), lint(CP), prof(CP),
sdb(CP), tmpnam(S).
Diagnostics
The diagnostics produced by the C compiler are sometimes
cryptic.
Notes
By default, the return value from a compiled C program is
completely random. The only two guaranteed ways to return a
specific value is to explicitly call exit(S) or to leave the
function main() with a ``return expression;'' construct.
(printed 6/18/89)