CC(1) | General Commands Manual | CC(1) |
cc
— front-end to
the C compiler
cc |
[-cEgkMPStvX ]
[-B prefix]
[-D
macro[=value]]
[-d flags]
[-f feature]
[-I path]
[-include file]
[-isystem path]
[-L path]
[-m option]
[-nodefaultlibs ]
[-nostartfiles ]
[-nostdinc ] [-nostdlib ]
[-O [level]]
[-o outfile]
[-pg ] [-pthread ]
[-shared ] [-static ]
[-U macro]
[-Wa ,options]
[-Wc ,options]
[-Wl ,options]
[-Wp ,options]
[-x language]
[file ...] |
The cc
utility provides a front-end to the
“portable C compiler”. Multiple files may be given on the
command line. Unrecognized options are all sent directly to
ld(1).
Filenames that end with .c are passed via cpp(1) → ccom(1) → as(1) → ld(1).
Filenames that end with .i are passed via ccom(1) → as(1) → ld(1).
Filenames that end with .s are passed via as(1) → ld(1).
Filenames that end with .S are passed via cpp(1) → as(1) → ld(1).
Filenames that end with .o are passed directly to ld(1).
The options are as follows:
-B
prefix-C
-c
-o
option is used. Note: cannot be combined with
-o
if multiple files are given.-D
macro[=value]-d
flagsany unknown flags are ignored.
-E
-o
option is used.-ffreestanding
-fPIC
-fpic
-funsigned-char
-fsigned-char
can be used to signify the opposite
behaviour. The default for the ‘char’ type depends on the
compiler target architecture.-fstack-protector
__SSP__
macro will be defined.-g
-g
flag to
ccom(1) to create debug output. Debug
information output can be disabled with -g0
.-I
path-include
file-isystem
path-k
-fpic
option.-L
path-M
-M
flag to
cpp(1) to generate dependencies for
make(1).-m
option-m
options can
be given, the following are supported:
-nodefaultlibs
-nostartfiles
-nostdinc
-nostdlib
-O
[level]__OPTIMIZE__
in the
cpp(1) preprocessor, and passes
-xdce
, -xdeljumps
,
-xtemps
and -xinline
to
ccom(1). If no level is given the
optimization level is increased, or optimizations can be disabled using
-O0
.-o
outfile-P
-pg
-pthread
_PTHREADS
preprocessor identifier for
cpp(1), and adds
-lpthread
to the
ld(1) linker arguments.-S
-o
option is used. Note: cannot be combined with
-o
if multiple files are given.-static
-t
-U
macro-v
cc
and shows what commands
will be run with their command line arguments.-Wa
,options-Wc
,options-Wl
,options-Wp
,options-X
-x
language-x
options are passed to
ccom(1).A few macros are predefined by cc
when
sent to cpp(1).
-v
option.-pthread
switch is used.-x
assembler-with-cpp option is specified.Also system- and/or machine-dependent macros may also be
predefined; for example: __NetBSD__
,
__ELF__
, and __i386__
.
The cc
command comes from the original
Portable C Compiler by S. C. Johnson, written in the
late 70's.
This product includes software developed or owned by Caldera International, Inc.
June 20, 2014 | x86_64 |