rcc(CP) 6 January 1993 rcc(CP) 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 dif- ferent compiler from the Microsoft C compiler that is available through the cc(CP) command. The AT&T compilation tools consist of a preprocessor, compiler, optim- izer, 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 linked. Compilation may be stopped after the completion of any pass if appropriate options are supplied. If compilation runs through the assembler, then an object file is produced called source.o, with .o substituted for .c. The .o file is normally deleted if a single C program is compiled and then immediately linked. In the same way, files whose names end in .s are taken to be assembly source programs and may be assembled and linked; files whose names end in .i are taken to be preprocessed C source pro- grams and may be compiled, optimized, assembled, and linked. Files whose names do not end in .c, .s, or .i are passed to the linker. Since rcc usually creates files in the current directory during compila- tion, you must run rcc in a directory in which a file can be created. The following options are accepted by rcc: -c Suppress the linking phase of compilation and do not remove object files. -dl Do not generate symbolic debugging line-number information. The -dl flag may be used with the -ds flag as -dsl (which is the default unless the -g flag is given). -ds Do not generate symbol attribute information for the symbolic debugger. -g Generate additional information needed for debuggers like dbxtra(CP), codeview(CP), and sdb(CP). -o outfile Produce an output object, outfile (the default name is a.out). This is a link editor option. -p Produce code that counts the number of times each routine is called; also, if linking takes place, link profiled versions of libc.a and libm.a (with -lm) and call monitor(S) automatically. mon.out will be created on normal termination of the object program. An execution profile can be generated by prof (see the prof(CP) manual page for more information). -ql Provides line profiling, that is, ``coverage'' and ``count'' statis- tics for each line of the program. The output from line profiling can be examined with lprof(CP). -qp Produce profiled code 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 standard output. -H Print out (on standard error) the path name of each file included during the current compilation. -O Do compilation phase optimization. This option has no effect on .s files. -P Run only cpp(CP) on the named C source files and leave the results in corresponding files suffixed .i. This option is passed to cpp(CP). -S Compile but do not assemble the named C source files, and leave the assembly-language output in corresponding files suffixed .s. -V Print the version(s) of the compiler, optimizer, assembler and/or linker 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 assem- bler. -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 argu- ments directly to the loader. See the cpp(CP) and ld(CP) manual pages for descriptions. Other arguments are taken to be C compatible object programs or 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, for example, prefixtool. For example, OLDrcc will call OLDcpp, OLDcomp, OLDoptim, OLDas, and OLDld and will link OLDcrt1.o. Therefore, you 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 temp- nam() in tmpnam(S)). Notes By default, the return value from a compiled C program is completely ran- dom. The only ways to guarantee a specific return value are to call exit(S) explicitly or to exit the function main() with a ``return expres- sion;'' construct. See also as(CP), cpp(CP), gencc(CP), ld(CP), lint(CP), prof(CP), sdb(CP), tmpnam(S)