CC(1) COMMAND REFERENCE CC(1) NAME cc - C compiler SYNOPSIS Cc [-c] [-f1167] [-go] [-g] [-o output] [-p] [-pg] [-w] [-C] [-Dname[=def]] [-E] [-Idir] [-O] [-O1] [-O2] [-nga] [-P] [- Pflag] [-R] [-S] [-Uname] [-q] [-v] [-Aflag] [-Xnnn] [-Znnn] [-GH68010]] [-M] filename ... [-llibrary] DESCRIPTION The UTek C compiler cc accepts several types of arguments: those whose names end with .c are taken to be C source programs; they are compiled, and each object program is left on the file in the current directory whose name is that of the source, with .o substituted for .c. If a single C program is compiled and loaded all at one go, the .o file is deleted, unless the -c option is used. In the same way, arguments whose names end with .s are taken to be assembly source programs and are assembled, producing a .o file. Other arguments are taken to be either loader option arguments, or C-compatible object programs, typically produced by an earlier cc run, or perhaps libraries of C- compatible routines. These programs, together with the results of any compilations specified, are loaded (in the order given) to produce an executable program with name a.out or as specified by the -o option. OPTIONS The following options are interpreted by cc: -c Suppress the loading phase of the compilation, and force an object file to be produced even if only one program is compiled. -f1167 Generate code for Weitek 1167 floating point accelerator. -go Have the compiler produce additional symbol table information for adb(1) or sdb(1). -g Have the compiler produce additional symbol table information for dbx(1). -o output Name the final output file output. If this option is used the file a.out will be left undisturbed. -p Arrange for the compiler to produce code which counts the Printed 5/12/88 1
CC(1) COMMAND REFERENCE CC(1) number of times each routine is called. If loading takes place, replace the standard startup routine by one which automatically calls monitor(3C) at the start and arranges to write out a mon.out file at normal termination of execution of the object program. Also, a profiling library is searched, in lieu of the standard C library. An execution profile can then be generated by use of prof(1). -pg Causes the compiler to produce counting code in the manner of -p, but invokes a run-time recording mechanism that keeps more extensive statistics and produces a gmon.out file at normal termination. An execution profile can then be generated by use of gprof(1). -w Suppress warning diagnostics. -C Prevent the macro preprocessor from eliding comments. This is equivalent to the option -PC. -Dname[=def] Define the name to the preprocessor, as if by #define. If def is not given, the name is defined as 1. This is equivalent to -PDname[=def]. -E Run only the macro preprocessor on the named C programs, and send the result to the standard output. -Idir #include files whose names do not begin with a slash / are always sought first in the directory of the filename argument, then in directories named in -I options, then in directories on a standard list (see VARIABLES). -O Invoke an object-code optimizer. -O1 Tells the compiler to optimize the program to be as fast as possible, even if it is necessary to make the program bigger. NOTE: This is not the same as the command cc -O on other UNIXr systems. -O2 Tells the optimizer to assume that no memory locations can be changed asynchronously: by external hardware in the case of I/O device registers, by other processes in the case of shared memory, or by signal handler routines. -nga By default, cc passes the -ga flag to the Green Hills compiler, telling it to always generate stack frames. Printed 5/12/88 2
CC(1) COMMAND REFERENCE CC(1) The -nga option prevents cc from doing so. This can be done in an attempt to generate faster, smaller code. -P As in -E, runs only the macro preprocessor. In this case, send the result to the file whose name is that of the source with .i substituted for the .c. -Poption Pass -option as an option to the preprocessor (where option is anything). -R Passed on to as, making initialized variables shared and read-only. -S Compile the named C programs, and leave the assembler- language output on corresponding files suffixed .s. -Uname Remove any initial definition of name. This is equivalent to the -PUname option. -q Suppress the printing of informative messages. This is the default. -v Enable the printing of informative messages (see above). -Aoption Pass -option as an option to the assembler. -Xnnn Pass the flag -Xnnn to the compiler. The Green Hills C compiler uses this flag to turn on a compile time option. See the Green Hills Software User's Manual for a list of available compile time options. -Znnn Pass the flag -Znnn to the compiler. The Green Hills C compiler uses this flag to turn off a compile time option. -GH68010 If this option is used, the compiler generates 68010 code only and neither IEEE floating point constants nor 68881 FPU code are generated. Otherwise, 68020 and 68881 code and IEEE floating point constants are generated. -M As in the -E option, -M runs only the macro preprocessor. In this case, the preprocessor is run with the -M passed to it, causing cc to write a list of dependencies to the standard output. -llibrary Printed 5/12/88 3
CC(1) COMMAND REFERENCE CC(1) Pass the given library to ld. The option -lc is the last to be passed on to ld. See ld(1) for more detail about load-time options. EXAMPLES The following example compiles program.c and puts the object code in program: cc program.c -o program FILES file.c input file file.o object file file.a object code archive file a.out loaded output (default) /tmp/ctm?????? temporary $TOPDIR/lib/cpp preprocessor /usr/lib/local/guestGHcom68 Green Hills C compiler on remote host $TOPDIR/lib/GHcomp Green Hills C compiler $TOPDIR/lib/crt0.o runtime startoff $TOPDIR/lib/mcrt0.o startoff for profiling $TOPDIR/lib/libc.a standard library, see intro(3) $TOPDIR/lib/libc_p.a profiling library, see intro(3) $TOPDIR[/$MACHTYPE]/usr/include standard directory for #include files mon.out file produced for analysis by prof(1) gmon.out file produced for analysis by gprof(1) DIAGNOSTICS The diagnostics produced by C itself are intended to be self-explanatory. Messages labeled cpp are generated during the preprocessing phase and messages labeled ccomp68 are generated during the compilation phase. Occasional messages Printed 5/12/88 4
CC(1) COMMAND REFERENCE CC(1) may be produced by the assembler or loader. These are labeled a68 and ld, respectively. VARIABLES TOPDIR Path name prepended to the pathnames of all the files used by cc to perform its job; this is used to control a cross environment. MACHTYPE Pathname component used to construct the directory name in which to find the included files. In addition, a define is passed to the preprocess of the form -D$MACHTYPE. SEE ALSO adb(1), as(1), ar(1), gprof(1), ld(1), make(1), prof(1), ranlib(1), and monitor(3c). Section 5A, C-68000 Compiler, of the UTek Tools manual. Printed 5/12/88 5
%%index%% na:192,67; sy:259,1223; de:1482,1230; op:2712,1003;3979,2825;7068,2592;9924,190; ex:10114,243; fi:10357,1967; di:12324,376;12964,99; va:13063,663; se:13726,407; %%index%%000000000194