Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dbx(1)

dde(1)

gprof(1)

ld(1)

prof(1)

monitor(3)

CC(1)                                BSD                                 CC(1)



NAME
     cc - C compiler

SYNOPSIS
     cc [ options ] file ...

DESCRIPTION
     cc is the Domain/OS BSD interface to the preprocessor (cpp), the Domain C
     compiler, and the link editor (ld).  cc accepts several types of
     arguments. It interprets arguments with names ending in .c as C source
     programs, compiles them, and leaves each object program on the file whose
     name is that of the source, with .o substituted for .c.  However, cc
     normally deletes the .o file if a single C program is compiled and loaded
     all at one go.  Assembly source programs (arguments whose names end with
     .s) are not supported.

     Not all standard UNIX options are available. The Domain/OS BSD cc command
     provides some unique options. The cc command will interpret any command
     line argument beginning with a dash (-), as a compiler or a preprocessor
     option. If cc doesn't recognize an option, it assumes that it is an
     option for the link editor ld(1) and passes it along.  cc recognizes the
     following as preprocessor options: -C, -D, -H, -I, and -U. The following
     are link editor options:  -a, -l, -m, -o, -r, -s, -t, -u, -x, -z, -L, -M,
     -V, and -A.

OPTIONS
     -a        Produce an object file for execution.  This is the default.
               Use -r to retain relocation information in the object module.
               If you specify both -a and -r, the link editor retains
               relocation information for all data except common symbols,
               which it allocates.  (ld switch)

     -Bstring  Prefix pathname to cpp, cc, and ld for substitute preprocessor,
               compiler, and linker passes. If name is empty it is taken to be
               /usr/lib/o.

     -c        Suppress the linking phase of the compilation and force an
               object file to be produced, even if only one program is
               compiled.

     -C        Prevent the preprocessor from stripping comments. (cpp switch)

     -Dname=def
     -Dname    Define the name to the preprocessor, as if by #define.  Ifyou
               do not specify a definition, define name as 1.  The -D switch
               has lower precedence than -U; if you use both for the same
               name, the name is undefined, regardless of the order the
               switches appear in. (cpp switch)

     -E        Run only the macro preprocessor on the named C programs, and
               send the result to the standard output.

     -g        Generate full run-time debugger information. This is the same
               as the  Aegis -dbs option to the Domain C compiler.

     -H        Print to stderr the pathname of every file included during this
               compilation. (cpp switch)

     -Idir     Change the search path for #include files with names not
               beginning with a slash (/).  Look first in  the directory of
               the source file; then in directories named in this option; and
               finally, in directories on a standard list.

     -lx       Search the library named libx.a.  cc searches libraries in the
               order that they appear on the command line.  The link editor
               searches for libraries in the directories specified by the
               environment variables LIBDIR and LLIBDIR (these generally
               resolve to /lib and /usr/lib).  You can specify additional
               library directories with the -L switch. (ld switch)

     -Ldir     Change the search path for libraries.  By default, the compiler
               looks for libx.a libraries in  the directories specified by
               LIBDIR and LLIBDIR.  This option allows you to specify a
               different directory before searching these standard
               directories.  This is useful if you have different versions of
               a library and you want to specify which one the link editor
               should use.  Note that this switch is effective only if it
               precedes a -l switch.  (ld switch)

     -m        Produce a map or listing of the input/output sections on
               standard input.  (ld switch)

     -M        Run only the macro preprocessor on the named C programs,
               requesting it to generate Makefile dependencies and send the
               result to the standard output.

     -o output Name the final output file output.  By default, output is
               a.out.  If you specify a different name, the system leaves any
               existing a.out file undisturbed.

     -O        Turn on compiler optimizations.

     -p        Arrange for the compiler to produce code which counts the
               number of times each routine is called. If the command does
               load, replace the standard startup routine by one which
               automatically calls monitor(1) at the start and arranges to
               write out a mon.out file at normal termination of execution of
               the object program. An execution profile can then be generated
               by use of prof(1).

     -P        Run only the macro preprocessor on the named C program, and
               leave the result on corresponding files suffixed with .i.

     -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).

     -r        Retain  relocation  entries in the output object module.
               Relocation entries must be preserved if the object file will be
               specified in a future ld or bind command.  The default is -a.
               (ld switch)

     -s        Strip line-number entries and symbol-table information from the
               output object file.  The switch is equivalent to using the
               strip(1) utility and is useful if  you want to reduce the size
               of the object module.  Note, however, that removing this
               information from a program makes it impossible to debug the
               program with a source level debugger (dbx or dde).  (ld switch)

     -t[p0l]   Find only the designated preprocessor (p), compiler passes (0),
               or linker (l) in the files whose names are constructed by a -B
               option. In the absence of a -B option, the name is taken to be
               /usr/lib/n.  The value -t ""  is equivalent to -t0l.  The -Y
               option performs the same function and is easier to use.

     -Tsystype Define the target system type (systype) for the compiled
               object; see the -A sys[type],sys option for a list of valid
               systype values.

     -u symname
               Enters symname as an undefined symbol in the symbol table.
               This switch is useful if you are using the cc command to load a
               library.  The symbol table is initially empty and needs an
               unresolved reference to force ld to load the first routine. (ld
               flag)

     -Uname    Remove any initial definition of name.  (cpp switch)

     -V        Output a message giving information about the version of ld
               being used. (ld switch)

     -w        Suppress warning diagnostics.

     -Wc,arg1[,arg2]
               Hand off the arguments argi to pass c where c is one of p, 0,
               or l, indicating the preprocessor, compiler, or linker.

     -Y[p0lSILU], dir
               Specify a new pathname and directory for the locations of the
               tools and directories designated by the first argument.  You
               can include only one letter or number per -Y switch, but there
               is no limit to the number of -Y switches per compilation.  The
               valid letters and numbers, and their meanings, are as follows:
                    p      Preprocessor (cpp)
                    0      Compiler (cc)
                    l      Link editor (ld)
                    S      Directory containing the startup routine
                           (/usr/lib/crt0.o)
                    I      Default include directory searched by the
                           preprocessor (/usr/include)
                    L      First default library directory searched by
                           the link editor
                    U      Second default library searched
                           by the link editor

               If the location of a tool is being specified, the new pathname
               for the tool is /dir/tool. If more than one -Y option is
               applied to any one tool or directory, the last occurrence
               holds.

     The Domain/OS BSD version of cc does not support the following options:
     -go, -lg, -R, -S, -f.

Domain/OS BSD EXTENSIONS
     The -A option identifies Domain/OS BSD extensions to cc and ld; see ld(1)
     for additional information about this option.

     -A nansi  Do not compile with ANSI rules.  This option passes -ntype to
               the compiler, and does not define the preprocessor symbol
               __STDC__.  See the Domain C language Reference for details
               about function prototypes.

     -A cpu,id Generate code for a particular class of processor; the default
               id is any.  Values for id are as follows:

                    any    Standard M68000 code
                    160    DSP160 code
                    460    DSP460 code
                    660    660 code
                    90     DSP90 code
                    330    DN330 code
                    560    DN560 code
                    570    DN570 code
                    580    DN580 code
                    3000   DN3000 code and DN4000 code
                    FPA1   Floating-Point Accelerator
                    FPX    Floating-Point Accelerator Board
                    PEB    Performance Enhancement Board

     -A sys[type],sys
               Define the target system type (sys) for the compiled object;
               sys may be one of the following:

                    any    Version independent
                    bsd4.2 Berkeley version 4.2
                    bsd4.3 Berkeley version 4.3
                    sys5   UNIX System V
                    sys5.3 UNIX System V Release 3

               This option replaces the -Tsystype option (which is supplied
               for backwards compatibility).

     -A run[type],sys
               Like -A sys[type],sys this option passes runtype information to
               the compiler and linker.

     Other arguments are taken to be 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.

EXAMPLE
     The following example compiles filename.c using the compiler in
     /usr/lib/tools/old/cc

          cc  -Y0,/usr/lib/old filename.c

DIAGNOSTICS
     The diagnostics produced by C itself are intended to be self-explanatory.
     The loader may produce occasional messages.

FILES
     file.c                Input file
     file.o                Object file
     a.out                 Loaded output (default)
     /tmp/ctm?             Temporary
     /usr/lib/cpp          Preprocessor
     /usr/apollo/lib/cc    Compiler
     /bin/ld               Link editor
     /usr/lib/crt0.o       Runtime startoff
     /usr/lib/mcrt0.o      Startoff for profiling
     /usr/lib/gcrt0.o      Startoff for gprof-profiling
     /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)

     The following files are not supported:

     /lib/ccom             Compiler
     /lib/sccom            Compiler for single precision floats
     /usr/c/occom          Backup compiler
     /usr/c/ocpp           Backup preprocessor
     /lib/c2               Optional optimizer
     /lib/libc.a           Standard library
     /usr/lib/libc_p.a     Profiling library

SEE ALSO
     dbx(1), dde(1), gprof(1), ld(1), prof(1), monitor(3)
     Domain C Language Reference
     Domain/OS Programming Environment Reference
     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

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026