CC(1) | General Commands Manual | CC(1) |
cc
— front-end to
the C compiler
cc |
[-cEgkMPSstvX ] [-ansi ]
[-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 ]
[-std= standard]
[-U macro]
[-Wa ,options]
[-Wc ,options]
[-Wl ,options]
[-Wp ,options]
[-x language]
[-z keyword]
[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 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:
-ansi
-std=c89
.-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
-O1
. Optimizations can be disabled using
-O0
. In situations where multiple optimization
flags are given, the last flag is the one used.-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.-s
cc
does not invoke the
linker.-static
-std=
standard-t
-U
macro-v
cc
and shows commands as
they are run with their command line arguments.-###
-v
except that the commands are not run,
and the arguments will be quoted if they contain unusual characters or
spaces.-Wa
,options-Wc
,options-Wl
,options-Wp
,options-X
-x
language-x
options are passed to
ccom(1).-z
keywordA 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 | Debian |