gcc: Invoking GCC
1
1 3 GCC Command Options
1 *********************
1
1 When you invoke GCC, it normally does preprocessing, compilation,
1 assembly and linking. The "overall options" allow you to stop this
1 process at an intermediate stage. For example, the '-c' option says not
1 to run the linker. Then the output consists of object files output by
11 the assembler. ⇒Options Controlling the Kind of Output Overall
Options.
1
1 Other options are passed on to one or more stages of processing. Some
1 options control the preprocessor and others the compiler itself. Yet
1 other options control the assembler and linker; most of these are not
1 documented here, since you rarely need to use any of them.
1
1 Most of the command-line options that you can use with GCC are useful
1 for C programs; when an option is only useful with another language
1 (usually C++), the explanation says so explicitly. If the description
1 for a particular option does not mention a source language, you can use
1 that option with all supported languages.
1
1 The usual way to run GCC is to run the executable called 'gcc', or
1 'MACHINE-gcc' when cross-compiling, or 'MACHINE-gcc-VERSION' to run a
1 specific version of GCC. When you compile C++ programs, you should
11 invoke GCC as 'g++' instead. ⇒Compiling C++ Programs Invoking
G++, for information about the differences in behavior between 'gcc' and
1 'g++' when compiling C++ programs.
1
1 The 'gcc' program accepts options and file names as operands. Many
1 options have multi-letter names; therefore multiple single-letter
1 options may _not_ be grouped: '-dv' is very different from '-d -v'.
1
1 You can mix options and other arguments. For the most part, the order
1 you use doesn't matter. Order does matter when you use several options
1 of the same kind; for example, if you specify '-L' more than once, the
1 directories are searched in the order specified. Also, the placement of
1 the '-l' option is significant.
1
1 Many options have long names starting with '-f' or with '-W'--for
1 example, '-fmove-loop-invariants', '-Wformat' and so on. Most of these
1 have both positive and negative forms; the negative form of '-ffoo' is
1 '-fno-foo'. This manual documents only one of these two forms,
1 whichever one is not the default.
1
1 ⇒Option Index, for an index to GCC's options.
1
Menu