This is Info file gcc.info, produced by Makeinfo version 1.68 from the
input file
/tantor/build/intel-xscale/xscale-010413/i686-pc-linux-gnulibc2.1/src/gcc/gcc.texi.

START-INFO-DIR-ENTRY
* Gcc: (gcc).                           Using and Porting the GNU C compiler.
END-INFO-DIR-ENTRY

INFO-DIR-SECTION Programming
START-INFO-DIR-ENTRY
* gcc: (gcc).                  The GNU Compiler Collection.
END-INFO-DIR-ENTRY
   This file documents the use and the internals of the GNU compiler.

   Published by the Free Software Foundation 59 Temple Place - Suite 330
Boston, MA 02111-1307 USA

   Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999 Free Software Foundation, Inc.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License" and "Funding
for Free Software" are included exactly as in the original, and
provided that the entire resulting derived work is distributed under
the terms of a permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License" and "Funding for Free Software", and this permission notice,
may be included in translations approved by the Free Software Foundation
instead of in the original English.


File: gcc.info,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GCC

Options for Linking
===================

   These options come into play when the compiler links object files
into an executable output file.  They are meaningless if the compiler is
not doing a link step.

`OBJECT-FILE-NAME'
     A file name that does not end in a special recognized suffix is
     considered to name an object file or library.  (Object files are
     distinguished from libraries by the linker according to the file
     contents.)  If linking is done, these object files are used as
     input to the linker.

`-c'
`-S'
`-E'
     If any of these options is used, then the linker is not run, and
     object file names should not be used as arguments.  *Note Overall
     Options::.

`-lLIBRARY'
     Search the library named LIBRARY when linking.

     It makes a difference where in the command you write this option;
     the linker searches processes libraries and object files in the
     order they are specified.  Thus, `foo.o -lz bar.o' searches
     library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
     refers to functions in `z', those functions may not be loaded.

     The linker searches a standard list of directories for the library,
     which is actually a file named `libLIBRARY.a'.  The linker then
     uses this file as if it had been specified precisely by name.

     The directories searched include several standard system
     directories plus any that you specify with `-L'.

     Normally the files found this way are library files--archive files
     whose members are object files.  The linker handles an archive
     file by scanning through it for members which define symbols that
     have so far been referenced but not defined.  But if the file that
     is found is an ordinary object file, it is linked in the usual
     fashion.  The only difference between using an `-l' option and
     specifying a file name is that `-l' surrounds LIBRARY with `lib'
     and `.a' and searches several directories.

`-lobjc'
     You need this special case of the `-l' option in order to link an
     Objective C program.

`-nostartfiles'
     Do not use the standard system startup files when linking.  The
     standard system libraries are used normally, unless `-nostdlib' or
     `-nodefaultlibs' is used.

`-nodefaultlibs'
     Do not use the standard system libraries when linking.  Only the
     libraries you specify will be passed to the linker.  The standard
     startup files are used normally, unless `-nostartfiles' is used.
     The compiler may generate calls to memcmp, memset, and memcpy for
     System V (and ANSI C) environments or to bcopy and bzero for BSD
     environments.  These entries are usually resolved by entries in
     libc.  These entry points should be supplied through some other
     mechanism when this option is specified.

`-nostdlib'
     Do not use the standard system startup files or libraries when
     linking.  No startup files and only the libraries you specify will
     be passed to the linker. The compiler may generate calls to
     memcmp, memset, and memcpy for System V (and ANSI C) environments
     or to bcopy and bzero for BSD environments.  These entries are
     usually resolved by entries in libc.  These entry points should be
     supplied through some other mechanism when this option is
     specified.

     One of the standard libraries bypassed by `-nostdlib' and
     `-nodefaultlibs' is `libgcc.a', a library of internal subroutines
     that GCC uses to overcome shortcomings of particular machines, or
     special needs for some languages.  (*Note Interfacing to GCC
     Output: Interface, for more discussion of `libgcc.a'.)  In most
     cases, you need `libgcc.a' even when you want to avoid other
     standard libraries.  In other words, when you specify `-nostdlib'
     or `-nodefaultlibs' you should usually specify `-lgcc' as well.
     This ensures that you have no unresolved references to internal GCC
     library subroutines.  (For example, `__main', used to ensure C++
     constructors will be called; *note `collect2': Collect2..)

`-s'
     Remove all symbol table and relocation information from the
     executable.

`-static'
     On systems that support dynamic linking, this prevents linking
     with the shared libraries.  On other systems, this option has no
     effect.

`-shared'
     Produce a shared object which can then be linked with other
     objects to form an executable.  Not all systems support this
     option.  You must also specify `-fpic' or `-fPIC' on some systems
     when you specify this option.

`-symbolic'
     Bind references to global symbols when building a shared object.
     Warn about any unresolved references (unless overridden by the
     link editor option `-Xlinker -z -Xlinker defs').  Only a few
     systems support this option.

`-Xlinker OPTION'
     Pass OPTION as an option to the linker.  You can use this to
     supply system-specific linker options which GCC does not know how
     to recognize.

     If you want to pass an option that takes an argument, you must use
     `-Xlinker' twice, once for the option and once for the argument.
     For example, to pass `-assert definitions', you must write
     `-Xlinker -assert -Xlinker definitions'.  It does not work to write
     `-Xlinker "-assert definitions"', because this passes the entire
     string as a single argument, which is not what the linker expects.

`-Wl,OPTION'
     Pass OPTION as an option to the linker.  If OPTION contains
     commas, it is split into multiple options at the commas.

`-u SYMBOL'
     Pretend the symbol SYMBOL is undefined, to force linking of
     library modules to define it.  You can use `-u' multiple times with
     different symbols to force loading of additional library modules.


File: gcc.info,  Node: Directory Options,  Next: Spec Files,  Prev: Link Options,  Up: Invoking GCC

Options for Directory Search
============================

   These options specify directories to search for header files, for
libraries and for parts of the compiler:

`-IDIR'
     Add the directory DIR to the head of the list of directories to be
     searched for header files.  This can be used to override a system
     header file, substituting your own version, since these
     directories are searched before the system header file
     directories.  If you use more than one `-I' option, the
     directories are scanned in left-to-right order; the standard
     system directories come after.

`-I-'
     Any directories you specify with `-I' options before the `-I-'
     option are searched only for the case of `#include "FILE"'; they
     are not searched for `#include <FILE>'.

     If additional directories are specified with `-I' options after
     the `-I-', these directories are searched for all `#include'
     directives.  (Ordinarily *all* `-I' directories are used this way.)

     In addition, the `-I-' option inhibits the use of the current
     directory (where the current input file came from) as the first
     search directory for `#include "FILE"'.  There is no way to
     override this effect of `-I-'.  With `-I.' you can specify
     searching the directory which was current when the compiler was
     invoked.  That is not exactly the same as what the preprocessor
     does by default, but it is often satisfactory.

     `-I-' does not inhibit the use of the standard system directories
     for header files.  Thus, `-I-' and `-nostdinc' are independent.

`-LDIR'
     Add directory DIR to the list of directories to be searched for
     `-l'.

`-BPREFIX'
     This option specifies where to find the executables, libraries,
     include files, and data files of the compiler itself.

     The compiler driver program runs one or more of the subprograms
     `cpp', `cc1', `as' and `ld'.  It tries PREFIX as a prefix for each
     program it tries to run, both with and without `MACHINE/VERSION/'
     (*note Target Options::.).

     For each subprogram to be run, the compiler driver first tries the
     `-B' prefix, if any.  If that name is not found, or if `-B' was
     not specified, the driver tries two standard prefixes, which are
     `/usr/lib/gcc/' and `/usr/local/lib/gcc-lib/'.  If neither of
     those results in a file name that is found, the unmodified program
     name is searched for using the directories specified in your
     `PATH' environment variable.

     `-B' prefixes that effectively specify directory names also apply
     to libraries in the linker, because the compiler translates these
     options into `-L' options for the linker.  They also apply to
     includes files in the preprocessor, because the compiler
     translates these options into `-isystem' options for the
     preprocessor.  In this case, the compiler appends `include' to the
     prefix.

     The run-time support file `libgcc.a' can also be searched for using
     the `-B' prefix, if needed.  If it is not found there, the two
     standard prefixes above are tried, and that is all.  The file is
     left out of the link if it is not found by those means.

     Another way to specify a prefix much like the `-B' prefix is to use
     the environment variable `GCC_EXEC_PREFIX'.  *Note Environment
     Variables::.

`-specs=FILE'
     Process FILE after the compiler reads in the standard `specs'
     file, in order to override the defaults that the `gcc' driver
     program uses when determining what switches to pass to `cc1',
     `cc1plus', `as', `ld', etc.  More than one `-specs='FILE can be
     specified on the command line, and they are processed in order,
     from left to right.


File: gcc.info,  Node: Spec Files,  Next: Target Options,  Prev: Directory Options,  Up: Invoking GCC

Specifying subprocesses and the switches to pass to them
========================================================

   `GCC' is a driver program.  It performs its job by invoking a
sequence of other programs to do the work of compiling, assembling and
linking.  GCC interprets its command-line parameters and uses these to
deduce which programs it should invoke, and which command-line options
it ought to place on their command lines.  This behaviour is controlled
by "spec strings".  In most cases there is one spec string for each
program that GCC can invoke, but a few programs have multiple spec
strings to control their behaviour.  The spec strings built into GCC can
be overridden by using the `-specs=' command-line switch to specify a
spec file.

   "Spec files" are plaintext files that are used to construct spec
strings.  They consist of a sequence of directives separated by blank
lines.  The type of directive is determined by the first non-whitespace
character on the line and it can be one of the following:

`%COMMAND'
     Issues a COMMAND to the spec file processor.  The commands that can
     appear here are:

    `%include <FILE>'
          Search for FILE and insert its text at the current point in
          the specs file.

    `%include_noerr <FILE>'
          Just like `%include', but do not generate an error message if
          the include file cannot be found.

    `%rename OLD_NAME NEW_NAME'
          Rename the spec string OLD_NAME to NEW_NAME.

`*[SPEC_NAME]:'
     This tells the compiler to create, override or delete the named
     spec string.  All lines after this directive up to the next
     directive or blank line are considered to be the text for the spec
     string.  If this results in an empty string then the spec will be
     deleted.  (Or, if the spec did not exist, then nothing will
     happened.)  Otherwise, if the spec does not currently exist a new
     spec will be created.  If the spec does exist then its contents
     will be overridden by the text of this directive, unless the first
     character of that text is the `+' character, in which case the
     text will be appended to the spec.

`[SUFFIX]:'
     Creates a new `[SUFFIX] spec' pair.  All lines after this directive
     and up to the next directive or blank line are considered to make
     up the spec string for the indicated suffix.  When the compiler
     encounters an input file with the named suffix, it will processes
     the spec string in order to work out how to compile that file.
     For example:

          .ZZ:
          z-compile -input %i

     This says that any input file whose name ends in `.ZZ' should be
     passed to the program `z-compile', which should be invoked with the
     command-line switch `-input' and with the result of performing the
     `%i' substitution.  (See below.)

     As an alternative to providing a spec string, the text that
     follows a suffix directive can be one of the following:

    `@LANGUAGE'
          This says that the suffix is an alias for a known LANGUAGE.
          This is similar to using the `-x' command-line switch to GCC
          to specify a language explicitly.  For example:

               .ZZ:
               @c++

          Says that .ZZ files are, in fact, C++ source files.

    `#NAME'
          This causes an error messages saying:

               NAME compiler not installed on this system.

     GCC already has an extensive list of suffixes built into it.  This
     directive will add an entry to the end of the list of suffixes, but
     since the list is searched from the end backwards, it is
     effectively possible to override earlier entries using this
     technique.

   GCC has the following spec strings built into it.  Spec files can
override these strings or create their own.  Note that individual
targets can also add their own spec strings to this list.

     asm          Options to pass to the assembler
     asm_final    Options to pass to the assembler post-processor
     cpp          Options to pass to the C preprocessor
     cc1          Options to pass to the C compiler
     cc1plus      Options to pass to the C++ compiler
     endfile      Object files to include at the end of the link
     link         Options to pass to the linker
     lib          Libraries to include on the command line to the linker
     libgcc       Decides which GCC support library to pass to the linker
     linker       Sets the name of the linker
     predefines   Defines to be passed to the C preprocessor
     signed_char  Defines to pass to CPP to say whether `char' is signed by default
     startfile    Object files to include at the start of the link

   Here is a small example of a spec file:

     %rename lib                 old_lib
     
     *lib:
     --start-group -lgcc -lc -leval1 --end-group %(old_lib)

   This example renames the spec called `lib' to `old_lib' and then
overrides the previous definition of `lib' with a new one.  The new
definition adds in some extra command-line options before including the
text of the old definition.

   "Spec strings" are a list of command-line options to be passed to
their corresponding program.  In addition, the spec strings can contain
`%'-prefixed sequences to substitute variable text or to conditionally
insert text into the command line.  Using these constructs it is
possible to generate quite complex command lines.

   Here is a table of all defined `%'-sequences for spec strings.  Note
that spaces are not generated automatically around the results of
expanding these sequences.  Therefore you can concatenate them together
or combine them with constant text in a single argument.

`%%'
     Substitute one `%' into the program name or argument.

`%i'
     Substitute the name of the input file being processed.

`%b'
     Substitute the basename of the input file being processed.  This
     is the substring up to (and not including) the last period and not
     including the directory.

`%d'
     Marks the argument containing or following the `%d' as a temporary
     file name, so that that file will be deleted if GCC exits
     successfully.  Unlike `%g', this contributes no text to the
     argument.

`%gSUFFIX'
     Substitute a file name that has suffix SUFFIX and is chosen once
     per compilation, and mark the argument in the same way as `%d'.
     To reduce exposure to denial-of-service attacks, the file name is
     now chosen in a way that is hard to predict even when previously
     chosen file names are known.  For example, `%g.s ... %g.o ... %g.s'
     might turn into `ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s'.  SUFFIX
     matches the regexp `[.A-Za-z]*' or the special string `%O', which
     is treated exactly as if `%O' had been preprocessed.  Previously,
     `%g' was simply substituted with a file name chosen once per
     compilation, without regard to any appended suffix (which was
     therefore treated just like ordinary text), making such attacks
     more likely to succeed.

`%uSUFFIX'
     Like `%g', but generates a new temporary file name even if
     `%uSUFFIX' was already seen.

`%USUFFIX'
     Substitutes the last file name generated with `%uSUFFIX',
     generating a new one if there is no such last file name.  In the
     absence of any `%uSUFFIX', this is just like `%gSUFFIX', except
     they don't share the same suffix *space*, so `%g.s ... %U.s ...
     %g.s ... %U.s' would involve the generation of two distinct file
     names, one for each `%g.s' and another for each `%U.s'.
     Previously, `%U' was simply substituted with a file name chosen
     for the previous `%u', without regard to any appended suffix.

`%w'
     Marks the argument containing or following the `%w' as the
     designated output file of this compilation.  This puts the argument
     into the sequence of arguments that `%o' will substitute later.

`%o'
     Substitutes the names of all the output files, with spaces
     automatically placed around them.  You should write spaces around
     the `%o' as well or the results are undefined.  `%o' is for use in
     the specs for running the linker.  Input files whose names have no
     recognized suffix are not compiled at all, but they are included
     among the output files, so they will be linked.

`%O'
     Substitutes the suffix for object files.  Note that this is
     handled specially when it immediately follows `%g, %u, or %U',
     because of the need for those to form complete file names.  The
     handling is such that `%O' is treated exactly as if it had already
     been substituted, except that `%g, %u, and %U' do not currently
     support additional SUFFIX characters following `%O' as they would
     following, for example, `.o'.

`%p'
     Substitutes the standard macro predefinitions for the current
     target machine.  Use this when running `cpp'.

`%P'
     Like `%p', but puts `__' before and after the name of each
     predefined macro, except for macros that start with `__' or with
     `_L', where L is an uppercase letter.  This is for ANSI C.

`%I'
     Substitute a `-iprefix' option made from GCC_EXEC_PREFIX.

`%s'
     Current argument is the name of a library or startup file of some
     sort.  Search for that file in a standard list of directories and
     substitute the full name found.

`%eSTR'
     Print STR as an error message.  STR is terminated by a newline.
     Use this when inconsistent options are detected.

`%|'
     Output `-' if the input for the current command is coming from a
     pipe.

`%(NAME)'
     Substitute the contents of spec string NAME at this point.

`%[NAME]'
     Like `%(...)' but put `__' around `-D' arguments.

`%x{OPTION}'
     Accumulate an option for `%X'.

`%X'
     Output the accumulated linker options specified by `-Wl' or a `%x'
     spec string.

`%Y'
     Output the accumulated assembler options specified by `-Wa'.

`%Z'
     Output the accumulated preprocessor options specified by `-Wp'.

`%v1'
     Substitute the major version number of GCC.  (For version 2.9.5,
     this is 2.)

`%v2'
     Substitute the minor version number of GCC.  (For version 2.9.5,
     this is 9.)

`%a'
     Process the `asm' spec.  This is used to compute the switches to
     be passed to the assembler.

`%A'
     Process the `asm_final' spec.  This is a spec string for passing
     switches to an assembler post-processor, if such a program is
     needed.

`%l'
     Process the `link' spec.  This is the spec for computing the
     command line passed to the linker.  Typically it will make use of
     the `%L %G %S %D and %E' sequences.

`%D'
     Dump out a `-L' option for each directory that GCC believes might
     contain startup files.  If the target supports multilibs then the
     current multilib directory will be prepended to each of these
     paths.

`%L'
     Process the `lib' spec.  This is a spec string for deciding which
     libraries should be included on the command line to the linker.

`%G'
     Process the `libgcc' spec.  This is a spec string for deciding
     which GCC support library should be included on the command line
     to the linker.

`%S'
     Process the `startfile' spec.  This is a spec for deciding which
     object files should be the first ones passed to the linker.
     Typically this might be a file named `crt0.o'.

`%E'
     Process the `endfile' spec.  This is a spec string that specifies
     the last object files that will be passed to the linker.

`%C'
     Process the `cpp' spec.  This is used to construct the arguments
     to be passed to the C preprocessor.

`%c'
     Process the `signed_char' spec.  This is intended to be used to
     tell cpp whether a char is signed.  It typically has the
     definition:
          %{funsigned-char:-D__CHAR_UNSIGNED__}

`%1'
     Process the `cc1' spec.  This is used to construct the options to
     be passed to the actual C compiler (`cc1').

`%2'
     Process the `cc1plus' spec.  This is used to construct the options
     to be passed to the actual C++ compiler (`cc1plus').

`%*'
     Substitute the variable part of a matched option.  See below.
     Note that each comma in the substituted string is replaced by a
     single space.

`%{`S'}'
     Substitutes the `-S' switch, if that switch was given to GCC.  If
     that switch was not specified, this substitutes nothing.  Note that
     the leading dash is omitted when specifying this option, and it is
     automatically inserted if the substitution is performed.  Thus the
     spec string `%{foo}' would match the command-line option `-foo'
     and would output the command line option `-foo'.

`%W{`S'}'
     Like %{`S'} but mark last argument supplied within as a file to be
     deleted on failure.

`%{`S'*}'
     Substitutes all the switches specified to GCC whose names start
     with `-S', but which also take an argument.  This is used for
     switches like `-o, -D, -I', etc.  GCC considers `-o foo' as being
     one switch whose names starts with `o'.  %{o*} would substitute
     this text, including the space.  Thus two arguments would be
     generated.

`%{^`S'*}'
     Like %{`S'*}, but don't put a blank between a switch and its
     argument.  Thus %{^o*} would only generate one argument, not two.

`%{`S'*:`X'}'
     Substitutes `X' if one or more switches whose names start with
     `-S' are specified to GCC.  Note that the tail part of the `-S'
     option (i.e. the part matched by the `*') will be substituted for
     each occurrence of `%*' within `X'.

`%{`S':`X'}'
     Substitutes `X', but only if the `-S' switch was given to GCC.

`%{!`S':`X'}'
     Substitutes `X', but only if the `-S' switch was *not* given to
     GCC.

`%{|`S':`X'}'
     Like %{`S':`X'}, but if no `S' switch, substitute `-'.

`%{|!`S':`X'}'
     Like %{!`S':`X'}, but if there is an `S' switch, substitute `-'.

`%{.`S':`X'}'
     Substitutes `X', but only if processing a file with suffix `S'.

`%{!.`S':`X'}'
     Substitutes `X', but only if *not* processing a file with suffix
     `S'.

`%{`S'|`P':`X'}'
     Substitutes `X' if either `-S' or `-P' was given to GCC.  This may
     be combined with `!' and `.' sequences as well, although they have
     a stronger binding than the `|'.  For example a spec string like
     this:

          %{.c:-foo} %{!.c:-bar} %{.c|d:-baz} %{!.c|d:-boggle}

     will output the following command-line options from the following
     input command-line options:

          fred.c        -foo -baz
          jim.d         -bar -boggle
          -d fred.c     -foo -baz -boggle
          -d jim.d      -bar -baz -boggle

   The conditional text `X' in a %{`S':`X'} or %{!`S':`X'} construct
may contain other nested `%' constructs or spaces, or even newlines.
They are processed as usual, as described above.

   The `-O, -f, -m, and -W' switches are handled specifically in these
constructs.  If another value of `-O' or the negated form of a `-f, -m,
or -W' switch is found later in the command line, the earlier switch
value is ignored, except with {`S'*} where `S' is just one letter,
which passes all matching options.

   The character `|' at the beginning of the predicate text is used to
indicate that a command should be piped to the following command, but
only if `-pipe' is specified.

   It is built into GCC which switches take arguments and which do not.
(You might think it would be useful to generalize this to allow each
compiler's spec to say which switches take arguments.  But this cannot
be done in a consistent fashion.  GCC cannot even decide which input
files have been specified without knowing which switches take arguments,
and it must know which input files to compile in order to tell which
compilers to run).

   GCC also knows implicitly that arguments starting in `-l' are to be
treated as compiler output files, and passed to the linker in their
proper position among the other output files.


File: gcc.info,  Node: Target Options,  Next: Submodel Options,  Prev: Spec Files,  Up: Invoking GCC

Specifying Target Machine and Compiler Version
==============================================

   By default, GCC compiles code for the same type of machine that you
are using.  However, it can also be installed as a cross-compiler, to
compile for some other type of machine.  In fact, several different
configurations of GCC, for different target machines, can be installed
side by side.  Then you specify which one to use with the `-b' option.

   In addition, older and newer versions of GCC can be installed side
by side.  One of them (probably the newest) will be the default, but
you may sometimes wish to use another.

`-b MACHINE'
     The argument MACHINE specifies the target machine for compilation.
     This is useful when you have installed GCC as a cross-compiler.

     The value to use for MACHINE is the same as was specified as the
     machine type when configuring GCC as a cross-compiler.  For
     example, if a cross-compiler was configured with `configure
     i386v', meaning to compile for an 80386 running System V, then you
     would specify `-b i386v' to run that cross compiler.

     When you do not specify `-b', it normally means to compile for the
     same type of machine that you are using.

`-V VERSION'
     The argument VERSION specifies which version of GCC to run.  This
     is useful when multiple versions are installed.  For example,
     VERSION might be `2.0', meaning to run GCC version 2.0.

     The default version, when you do not specify `-V', is the last
     version of GCC that you installed.

   The `-b' and `-V' options actually work by controlling part of the
file name used for the executable files and libraries used for
compilation.  A given version of GCC, for a given target machine, is
normally kept in the directory `/usr/local/lib/gcc-lib/MACHINE/VERSION'.

   Thus, sites can customize the effect of `-b' or `-V' either by
changing the names of these directories or adding alternate names (or
symbolic links).  If in directory `/usr/local/lib/gcc-lib/' the file
`80386' is a link to the file `i386v', then `-b 80386' becomes an alias
for `-b i386v'.

   In one respect, the `-b' or `-V' do not completely change to a
different compiler: the top-level driver program `gcc' that you
originally invoked continues to run and invoke the other executables
(preprocessor, compiler per se, assembler and linker) that do the real
work.  However, since no real work is done in the driver program, it
usually does not matter that the driver program in use is not the one
for the specified target and version.

   The only way that the driver program depends on the target machine is
in the parsing and handling of special machine-specific options.
However, this is controlled by a file which is found, along with the
other executables, in the directory for the specified version and
target machine.  As a result, a single installed driver program adapts
to any specified target machine and compiler version.

   The driver program executable does control one significant thing,
however: the default version and target machine.  Therefore, you can
install different instances of the driver program, compiled for
different targets or versions, under different names.

   For example, if the driver for version 2.0 is installed as `ogcc'
and that for version 2.1 is installed as `gcc', then the command `gcc'
will use version 2.1 by default, while `ogcc' will use 2.0 by default.
However, you can choose either version with either command with the
`-V' option.


File: gcc.info,  Node: Submodel Options,  Next: Code Gen Options,  Prev: Target Options,  Up: Invoking GCC

Hardware Models and Configurations
==================================

   Earlier we discussed the standard option `-b' which chooses among
different installed compilers for completely different target machines,
such as Vax vs. 68000 vs. 80386.

   In addition, each of these target machine types can have its own
special options, starting with `-m', to choose among various hardware
models or configurations--for example, 68010 vs 68020, floating
coprocessor or none.  A single installed version of the compiler can
compile for any model or configuration, according to the options
specified.

   Some configurations of the compiler also support additional special
options, usually for compatibility with other compilers on the same
platform.

   These options are defined by the macro `TARGET_SWITCHES' in the
machine description.  The default for the options is also defined by
that macro, which enables you to change the defaults.

* Menu:

* M680x0 Options::
* VAX Options::
* SPARC Options::
* Convex Options::
* AMD29K Options::
* ARM Options::
* Thumb Options::
* MN10200 Options::
* MN10300 Options::
* M32R/D/X Options::
* M88K Options::
* RS/6000 and PowerPC Options::
* RT Options::
* MIPS Options::
* i386 Options::
* HPPA Options::
* Intel 960 Options::
* DEC Alpha Options::
* Clipper Options::
* H8/300 Options::
* SH Options::
* System V Options::
* TMS320C3x/C4x Options::
* V850 Options::
* ARC Options::
* NS32K Options::
* AVR Options::
* MCore Options::
* D10V Options::

* D30V Options::


File: gcc.info,  Node: M680x0 Options,  Next: VAX Options,  Up: Submodel Options

M680x0 Options
--------------

   These are the `-m' options defined for the 68000 series.  The default
values for these options depends on which style of 68000 was selected
when the compiler was configured; the defaults for the most common
choices are given below.

`-m68000'
`-mc68000'
     Generate output for a 68000.  This is the default when the
     compiler is configured for 68000-based systems.

     Use this option for microcontrollers with a 68000 or EC000 core,
     including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.

`-m68020'
`-mc68020'
     Generate output for a 68020.  This is the default when the
     compiler is configured for 68020-based systems.

`-m68881'
     Generate output containing 68881 instructions for floating point.
     This is the default for most 68020 systems unless `-nfp' was
     specified when the compiler was configured.

`-m68030'
     Generate output for a 68030.  This is the default when the
     compiler is configured for 68030-based systems.

`-m68040'
     Generate output for a 68040.  This is the default when the
     compiler is configured for 68040-based systems.

     This option inhibits the use of 68881/68882 instructions that have
     to be emulated by software on the 68040.  Use this option if your
     68040 does not have code to emulate those instructions.

`-m68060'
     Generate output for a 68060.  This is the default when the
     compiler is configured for 68060-based systems.

     This option inhibits the use of 68020 and 68881/68882 instructions
     that have to be emulated by software on the 68060.  Use this
     option if your 68060 does not have code to emulate those
     instructions.

`-mcpu32'
     Generate output for a CPU32. This is the default when the compiler
     is configured for CPU32-based systems.

     Use this option for microcontrollers with a CPU32 or CPU32+ core,
     including the 68330, 68331, 68332, 68333, 68334, 68336, 68340,
     68341, 68349 and 68360.

`-m5200'
     Generate output for a 520X "coldfire" family cpu.  This is the
     default when the compiler is configured for 520X-based systems.

     Use this option for microcontroller with a 5200 core, including
     the MCF5202, MCF5203, MCF5204 and MCF5202.

`-m68020-40'
     Generate output for a 68040, without using any of the new
     instructions.  This results in code which can run relatively
     efficiently on either a 68020/68881 or a 68030 or a 68040.  The
     generated code does use the 68881 instructions that are emulated
     on the 68040.

`-m68020-60'
     Generate output for a 68060, without using any of the new
     instructions.  This results in code which can run relatively
     efficiently on either a 68020/68881 or a 68030 or a 68040.  The
     generated code does use the 68881 instructions that are emulated
     on the 68060.

`-mfpa'
     Generate output containing Sun FPA instructions for floating point.

`-msoft-float'
     Generate output containing library calls for floating point.
     *Warning:* the requisite libraries are not available for all m68k
     targets.  Normally the facilities of the machine's usual C
     compiler are used, but this can't be done directly in
     cross-compilation.  You must make your own arrangements to provide
     suitable library functions for cross-compilation.  The embedded
     targets `m68k-*-aout' and `m68k-*-coff' do provide software
     floating point support.

`-mshort'
     Consider type `int' to be 16 bits wide, like `short int'.

`-mnobitfield'
     Do not use the bit-field instructions.  The `-m68000', `-mcpu32'
     and `-m5200' options imply `-mnobitfield'.

`-mbitfield'
     Do use the bit-field instructions.  The `-m68020' option implies
     `-mbitfield'.  This is the default if you use a configuration
     designed for a 68020.

`-mrtd'
     Use a different function-calling convention, in which functions
     that take a fixed number of arguments return with the `rtd'
     instruction, which pops their arguments while returning.  This
     saves one instruction in the caller since there is no need to pop
     the arguments there.

     This calling convention is incompatible with the one normally used
     on Unix, so you cannot use it if you need to call libraries
     compiled with the Unix compiler.

     Also, you must provide function prototypes for all functions that
     take variable numbers of arguments (including `printf'); otherwise
     incorrect code will be generated for calls to those functions.

     In addition, seriously incorrect code will result if you call a
     function with too many arguments.  (Normally, extra arguments are
     harmlessly ignored.)

     The `rtd' instruction is supported by the 68010, 68020, 68030,
     68040, 68060 and CPU32 processors, but not by the 68000 or 5200.

`-malign-int'
`-mno-align-int'
     Control whether GCC aligns `int', `long', `long long', `float',
     `double', and `long double' variables on a 32-bit boundary
     (`-malign-int') or a 16-bit boundary (`-mno-align-int').  Aligning
     variables on 32-bit boundaries produces code that runs somewhat
     faster on processors with 32-bit busses at the expense of more
     memory.

     *Warning:* if you use the `-malign-int' switch, GCC will align
     structures containing the above types  differently than most
     published application binary interface specifications for the m68k.

`-mpcrel'
     Use the pc-relative addressing mode of the 68000 directly, instead
     of using a global offset table.  At present, this option implies
     -fpic, allowing at most a 16-bit offset for pc-relative
     addressing.  -fPIC is not presently supported with -mpcrel, though
     this could be supported for 68020 and higher processors.

`-mno-strict-align'
`-mstrict-align'
     Do not (do) assume that unaligned memory references will be
     handled by the system.


File: gcc.info,  Node: VAX Options,  Next: SPARC Options,  Prev: M680x0 Options,  Up: Submodel Options

VAX Options
-----------

   These `-m' options are defined for the Vax:

`-munix'
     Do not output certain jump instructions (`aobleq' and so on) that
     the Unix assembler for the Vax cannot handle across long ranges.

`-mgnu'
     Do output those jump instructions, on the assumption that you will
     assemble with the GNU assembler.

`-mg'
     Output code for g-format floating point numbers instead of
     d-format.


File: gcc.info,  Node: SPARC Options,  Next: Convex Options,  Prev: VAX Options,  Up: Submodel Options

SPARC Options
-------------

   These `-m' switches are supported on the SPARC:

`-mno-app-regs'
`-mapp-regs'
     Specify `-mapp-regs' to generate output using the global registers
     2 through 4, which the SPARC SVR4 ABI reserves for applications.
     This is the default.

     To be fully SVR4 ABI compliant at the cost of some performance
     loss, specify `-mno-app-regs'.  You should compile libraries and
     system software with this option.

`-mfpu'
`-mhard-float'
     Generate output containing floating point instructions.  This is
     the default.

`-mno-fpu'
`-msoft-float'
     Generate output containing library calls for floating point.
     *Warning:* the requisite libraries are not available for all SPARC
     targets.  Normally the facilities of the machine's usual C
     compiler are used, but this cannot be done directly in
     cross-compilation.  You must make your own arrangements to provide
     suitable library functions for cross-compilation.  The embedded
     targets `sparc-*-aout' and `sparclite-*-*' do provide software
     floating point support.

     `-msoft-float' changes the calling convention in the output file;
     therefore, it is only useful if you compile *all* of a program with
     this option.  In particular, you need to compile `libgcc.a', the
     library that comes with GCC, with `-msoft-float' in order for this
     to work.

`-mhard-quad-float'
     Generate output containing quad-word (long double) floating point
     instructions.

`-msoft-quad-float'
     Generate output containing library calls for quad-word (long
     double) floating point instructions.  The functions called are
     those specified in the SPARC ABI.  This is the default.

     As of this writing, there are no sparc implementations that have
     hardware support for the quad-word floating point instructions.
     They all invoke a trap handler for one of these instructions, and
     then the trap handler emulates the effect of the instruction.
     Because of the trap handler overhead, this is much slower than
     calling the ABI library routines.  Thus the `-msoft-quad-float'
     option is the default.

`-mno-epilogue'
`-mepilogue'
     With `-mepilogue' (the default), the compiler always emits code for
     function exit at the end of each function.  Any function exit in
     the middle of the function (such as a return statement in C) will
     generate a jump to the exit code at the end of the function.

     With `-mno-epilogue', the compiler tries to emit exit code inline
     at every function exit.

`-mno-flat'
`-mflat'
     With `-mflat', the compiler does not generate save/restore
     instructions and will use a "flat" or single register window
     calling convention.  This model uses %i7 as the frame pointer and
     is compatible with the normal register window model.  Code from
     either may be intermixed.  The local registers and the input
     registers (0-5) are still treated as "call saved" registers and
     will be saved on the stack as necessary.

     With `-mno-flat' (the default), the compiler emits save/restore
     instructions (except for leaf functions) and is the normal mode of
     operation.

`-mno-unaligned-doubles'
`-munaligned-doubles'
     Assume that doubles have 8 byte alignment.  This is the default.

     With `-munaligned-doubles', GCC assumes that doubles have 8 byte
     alignment only if they are contained in another type, or if they
     have an absolute address.  Otherwise, it assumes they have 4 byte
     alignment.  Specifying this option avoids some rare compatibility
     problems with code generated by other compilers.  It is not the
     default because it results in a performance loss, especially for
     floating point code.

`-mno-faster-structs'
`-mfaster-structs'
     With `-mfaster-structs', the compiler assumes that structures
     should have 8 byte alignment.  This enables the use of pairs of
     `ldd' and `std' instructions for copies in structure assignment,
     in place of twice as many `ld' and `st' pairs.  However, the use
     of this changed alignment directly violates the Sparc ABI.  Thus,
     it's intended only for use on targets where the developer
     acknowledges that their resulting code will not be directly in
     line with the rules of the ABI.

`-mv8'
`-msparclite'
     These two options select variations on the SPARC architecture.

     By default (unless specifically configured for the Fujitsu
     SPARClite), GCC generates code for the v7 variant of the SPARC
     architecture.

     `-mv8' will give you SPARC v8 code.  The only difference from v7
     code is that the compiler emits the integer multiply and integer
     divide instructions which exist in SPARC v8 but not in SPARC v7.

     `-msparclite' will give you SPARClite code.  This adds the integer
     multiply, integer divide step and scan (`ffs') instructions which
     exist in SPARClite but not in SPARC v7.

     These options are deprecated and will be deleted in a future GCC
     release.  They have been replaced with `-mcpu=xxx'.

`-mcypress'
`-msupersparc'
     These two options select the processor for which the code is
     optimised.

     With `-mcypress' (the default), the compiler optimizes code for the
     Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx
     series.  This is also appropriate for the older SparcStation 1, 2,
     IPX etc.

     With `-msupersparc' the compiler optimizes code for the SuperSparc
     cpu, as used in the SparcStation 10, 1000 and 2000 series. This
     flag also enables use of the full SPARC v8 instruction set.

     These options are deprecated and will be deleted in a future GCC
     release.  They have been replaced with `-mcpu=xxx'.

`-mcpu=CPU_TYPE'
     Set the instruction set, register set, and instruction scheduling
     parameters for machine type CPU_TYPE.  Supported values for
     CPU_TYPE are `v7', `cypress', `v8', `supersparc', `sparclite',
     `hypersparc', `sparclite86x', `f930', `f934', `sparclet',
     `tsc701', `v9', and `ultrasparc'.

     Default instruction scheduling parameters are used for values that
     select an architecture and not an implementation.  These are `v7',
     `v8', `sparclite', `sparclet', `v9'.

     Here is a list of each supported architecture and their supported
     implementations.

              v7:             cypress
              v8:             supersparc, hypersparc
              sparclite:      f930, f934, sparclite86x
              sparclet:       tsc701
              v9:             ultrasparc

`-mtune=CPU_TYPE'
     Set the instruction scheduling parameters for machine type
     CPU_TYPE, but do not set the instruction set or register set that
     the option `-mcpu='CPU_TYPE would.

     The same values for `-mcpu='CPU_TYPE are used for `-mtune='
     CPU_TYPE, though the only useful values are those that select a
     particular cpu implementation: `cypress', `supersparc',
     `hypersparc', `f930', `f934', `sparclite86x', `tsc701',
     `ultrasparc'.

   These `-m' switches are supported in addition to the above on the
SPARCLET processor.

`-mlittle-endian'
     Generate code for a processor running in little-endian mode.

`-mlive-g0'
     Treat register `%g0' as a normal register.  GCC will continue to
     clobber it as necessary but will not assume it always reads as 0.

`-mbroken-saverestore'
     Generate code that does not use non-trivial forms of the `save' and
     `restore' instructions.  Early versions of the SPARCLET processor
     do not correctly handle `save' and `restore' instructions used with
     arguments.  They correctly handle them used without arguments.  A
     `save' instruction used without arguments increments the current
     window pointer but does not allocate a new stack frame.  It is
     assumed that the window overflow trap handler will properly handle
     this case as will interrupt handlers.

   These `-m' switches are supported in addition to the above on SPARC
V9 processors in 64 bit environments.

`-mlittle-endian'
     Generate code for a processor running in little-endian mode.

`-m32'
`-m64'
     Generate code for a 32 bit or 64 bit environment.  The 32 bit
     environment sets int, long and pointer to 32 bits.  The 64 bit
     environment sets int to 32 bits and long and pointer to 64 bits.

`-mcmodel=medlow'
     Generate code for the Medium/Low code model: the program must be
     linked in the low 32 bits of the address space.  Pointers are 64
     bits.  Programs can be statically or dynamically linked.

`-mcmodel=medmid'
     Generate code for the Medium/Middle code model: the program must
     be linked in the low 44 bits of the address space, the text
     segment must be less than 2G bytes, and data segment must be
     within 2G of the text segment.  Pointers are 64 bits.

`-mcmodel=medany'
     Generate code for the Medium/Anywhere code model: the program may
     be linked anywhere in the address space, the text segment must be
     less than 2G bytes, and data segment must be within 2G of the text
     segment.  Pointers are 64 bits.

`-mcmodel=embmedany'
     Generate code for the Medium/Anywhere code model for embedded
     systems: assume a 32 bit text and a 32 bit data segment, both
     starting anywhere (determined at link time).  Register %g4 points
     to the base of the data segment.  Pointers still 64 bits.
     Programs are statically linked, PIC is not supported.

`-mstack-bias'
`-mno-stack-bias'
     With `-mstack-bias', GCC assumes that the stack pointer, and frame
     pointer if present, are offset by -2047 which must be added back
     when making stack frame references.  Otherwise, assume no such
     offset is present.


File: gcc.info,  Node: Convex Options,  Next: AMD29K Options,  Prev: SPARC Options,  Up: Submodel Options

Convex Options
--------------

   These `-m' options are defined for Convex:

`-mc1'
     Generate output for C1.  The code will run on any Convex machine.
     The preprocessor symbol `__convex__c1__' is defined.

`-mc2'
     Generate output for C2.  Uses instructions not available on C1.
     Scheduling and other optimizations are chosen for max performance
     on C2.  The preprocessor symbol `__convex_c2__' is defined.

`-mc32'
     Generate output for C32xx.  Uses instructions not available on C1.
     Scheduling and other optimizations are chosen for max performance
     on C32.  The preprocessor symbol `__convex_c32__' is defined.

`-mc34'
     Generate output for C34xx.  Uses instructions not available on C1.
     Scheduling and other optimizations are chosen for max performance
     on C34.  The preprocessor symbol `__convex_c34__' is defined.

`-mc38'
     Generate output for C38xx.  Uses instructions not available on C1.
     Scheduling and other optimizations are chosen for max performance
     on C38.  The preprocessor symbol `__convex_c38__' is defined.

`-margcount'
     Generate code which puts an argument count in the word preceding
     each argument list.  This is compatible with regular CC, and a few
     programs may need the argument count word.  GDB and other
     source-level debuggers do not need it; this info is in the symbol
     table.

`-mnoargcount'
     Omit the argument count word.  This is the default.

`-mvolatile-cache'
     Allow volatile references to be cached.  This is the default.

`-mvolatile-nocache'
     Volatile references bypass the data cache, going all the way to
     memory.  This is only needed for multi-processor code that does
     not use standard synchronization instructions.  Making
     non-volatile references to volatile locations will not necessarily
     work.

`-mlong32'
     Type long is 32 bits, the same as type int.  This is the default.

`-mlong64'
     Type long is 64 bits, the same as type long long.  This option is
     useless, because no library support exists for it.

