home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
bbs
/
gnu
/
gcc-2.3.3-src.lha
/
GNU
/
src
/
amiga
/
gcc-2.3.3
/
gcc.info-3
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-02-06
|
49KB
|
951 lines
This is Info file gcc.info, produced by Makeinfo-1.49 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Copyright (C) 1988, 1989, 1992 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 "Protect
Your Freedom--Fight `Look And Feel'" 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
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 "Protect Your Freedom--Fight `Look And Feel'", 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.
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'
This special case of the `-l' option is what you need to do when
you link an Objective C program.
`-nostdlib'
Don't use the standard system libraries and startup files when
linking. Only the files you specify will be passed to the linker.
`-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. Only a few systems support 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 GNU CC 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: Target Options, 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'
Append directory DIR to the list of directories searched for
include files.
`-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 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.
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::.
File: gcc.info, Node: Target Options, Next: Submodel Options, Prev: Directory Options, Up: Invoking GCC
Specifying Target Machine and Compiler Version
==============================================
By default, GNU CC compiles code for the same type of mac