-->

Previous | Table of Contents | Next

Page 181

_P Tell the preprocessor not to generate #line commands. Used with the _E option.
_M [_MG] Tell the preprocessor to output a rule suitable for make describing the dependencies of each object file. For each source file, the preprocessor outputs one make -rule whose target is the object filename for that source file and whose dependencies are all the files that have been included with #include. This rule may be a single line or may be continued with \-newline if it is long. The list of rules is printed on standard output instead of the preprocessed C program.
_M implies _E.
_MG says to treat missing header files as generated files and assume they live in the same directory as the source file. It must be specified in addition to _M.
_MM [_MG] Like _M but the output mentions only the user header files included with #include " file ". System header files included with #include < file > are omitted.
_MD Like _M but the dependency information is written to files with names made by replacing .o with .d at the end of the output filenames. This is in addition to compiling the file as specified; _MD does not inhibit ordinary compilation the way _M does. The Mach utility md can be used to merge the .d files into a single dependency file suitable for using with the make command.
_MMD Like _MD except mention only user header files, not system header files.
_H Print the name of each header file used, in addition to other normal activities.
_Aquestion(answer) Assert the answer answer for question, in case it is tested with a preprocessor conditional such as #if #question(answer). _A_ disables the standard assertions that normally describe the target machine.
_Aquestion ( answer ) Assert the answer answer for question, in case it is tested with a preprocessor conditional such as #if # question ( answer ). _A_disables the standard assertions that normally describe the target machine.
_Dmacro Define macro macro with the string 1 as its definition.
_Dmacro=defn Define macro macro as defn. All instances of _D on the command line are processed before any
_U options.
_Umacro Undefine macro macro. _U options are evaluated after all _D options, but before any _include and _imacros options.
_dM Tell the preprocessor to output only a list of the macro definitions that are in effect at the end of preprocessing. Used with the _E option.
_dD Tell the preprocessor to pass all macro definitions into the output, in their proper sequence in the rest of the output.
_dN Like _dD except that the macro arguments and contents are omitted. Only #define name is included in the output.

ASSEMBLER OPTION

_Wa,option Pass option as an option to the assembler. If option contains commas, it is split into multiple options at the commas.

LINKER OPTIONS

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 filename 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 gcc does a link step, these object files are used as input to the linker.
_llibrary Use the library named library when linking. The linker searches a standard list of directories for the library, which is actually a file named lib library.a. The linker then uses this file as if it had been specified precisely by name.

Page 182

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 that define symbols that have so far been referenced but not defined. However, if the linker finds an ordinary object file rather than a library, the object file is linked in the usual fashion. The only difference between using an _l option and specifying a filename 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 libraries are used normally.
_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.

DIRECTIORY OPTIONS

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 that 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 (or, for C++, cc1plus), as, and ld. It tries prefix as a prefix for each program it tries to run, both with and without machine / version /.

Previous | Table of Contents | Next