?? invoke.texi
字號:
@c Copyright (C) 1988,89,92,93,94,95,96,1997 Free Software Foundation, Inc.@c This is part of the GCC manual.@c For copying conditions, see the file gcc.texi.@node Invoking GCC@chapter GNU CC Command Options@cindex GNU CC command options@cindex command options@cindex options, GNU CC commandWhen you invoke GNU CC, it normally does preprocessing, compilation,assembly and linking. The ``overall options'' allow you to stop thisprocess at an intermediate stage. For example, the @samp{-c} optionsays not to run the linker. Then the output consists of object filesoutput by the assembler.Other options are passed on to one stage of processing. Some optionscontrol the preprocessor and others the compiler itself. Yet otheroptions control the assembler and linker; most of these are notdocumented here, since you rarely need to use any of them.@cindex C compilation optionsMost of the command line options that you can use with GNU CC are usefulfor C programs; when an option is only useful with another language(usually C++), the explanation says so explicitly. If the descriptionfor a particular option does not mention a source language, you can usethat option with all supported languages.@cindex C++ compilation options@xref{Invoking G++,,Compiling C++ Programs}, for a summary of specialoptions for compiling C++ programs.@cindex grouping options@cindex options, groupingThe @code{gcc} program accepts options and file names as operands. Manyoptions have multiletter names; therefore multiple single-letter optionsmay @emph{not} be grouped: @samp{-dr} is very different from @w{@samp{-d-r}}.@cindex order of options@cindex options, orderYou can mix options and other arguments. For the most part, the orderyou use doesn't matter. Order does matter when you use several optionsof the same kind; for example, if you specify @samp{-L} more than once,the directories are searched in the order specified.Many options have long names starting with @samp{-f} or with@samp{-W}---for example, @samp{-fforce-mem},@samp{-fstrength-reduce}, @samp{-Wformat} and so on. Most ofthese have both positive and negative forms; the negative form of@samp{-ffoo} would be @samp{-fno-foo}. This manual documentsonly one of these two forms, whichever one is not the default.@menu* Option Summary:: Brief list of all options, without explanations.* Overall Options:: Controlling the kind of output: an executable, object files, assembler files, or preprocessed source.* Invoking G++:: Compiling C++ programs.* C Dialect Options:: Controlling the variant of C language compiled.* C++ Dialect Options:: Variations on C++.* Warning Options:: How picky should the compiler be?* Debugging Options:: Symbol tables, measurements, and debugging dumps.* Optimize Options:: How much optimization?* Preprocessor Options:: Controlling header files and macro definitions. Also, getting dependency information for Make.* Assembler Options:: Passing options to the assembler.* Link Options:: Specifying libraries and so on.* Directory Options:: Where to find header files and libraries. Where to find the compiler executable files.* Target Options:: Running a cross-compiler, or an old version of GNU CC.* Submodel Options:: Specifying minor hardware or convention variations, such as 68010 vs 68020.* Code Gen Options:: Specifying conventions for function calls, data layout and register usage.* Environment Variables:: Env vars that affect GNU CC.* Running Protoize:: Automatically adding or removing function prototypes.@end menu@node Option Summary@section Option SummaryHere is a summary of all the options, grouped by type. Explanations arein the following sections.@table @emph@item Overall Options@xref{Overall Options,,Options Controlling the Kind of Output}.@smallexample-c -S -E -o @var{file} -pipe -v -x @var{language}@end smallexample@item C Language Options@xref{C Dialect Options,,Options Controlling C Dialect}.@smallexample-ansi -fallow-single-precision -fcond-mismatch -fno-asm-fno-builtin -ffreestanding -fhosted -fsigned-bitfields -fsigned-char-funsigned-bitfields -funsigned-char -fwritable-strings-traditional -traditional-cpp -trigraphs@end smallexample@item C++ Language Options@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.@smallexample-fall-virtual -fdollars-in-identifiers -felide-constructors-fenum-int-equiv -fexternal-templates -ffor-scope -fno-for-scope-fhandle-signatures -fmemoize-lookups -fname-mangling-version-@var{n}-fno-default-inline -fno-gnu-keywords -fnonnull-objects -fguiding-decls-foperator-names -fstrict-prototype -fthis-is-variable-ftemplate-depth-@var{n} -nostdinc++ -traditional +e@var{n}@end smallexample@item Warning Options@xref{Warning Options,,Options to Request or Suppress Warnings}.@smallexample-fsyntax-only -pedantic -pedantic-errors-w -W -Wall -Waggregate-return -Wbad-function-cast-Wcast-align -Wcast-qual -Wchar-subscript -Wcomment-Wconversion -Werror -Wformat-Wid-clash-@var{len} -Wimplicit -Wimplicit-int -Wimplicit-function-declarations -Wimport -Winline-Wlarger-than-@var{len} -Wmain -Wmissing-declarations-Wmissing-prototypes -Wnested-externs-Wno-import -Wold-style-cast -Woverloaded-virtual -Wparentheses-Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type -Wshadow-Wsign-compare -Wstrict-prototypes -Wswitch -Wsynth-Wtemplate-debugging -Wtraditional -Wtrigraphs-Wundef -Wuninitialized -Wunused -Wwrite-strings@end smallexample@item Debugging Options@xref{Debugging Options,,Options for Debugging Your Program or GCC}.@smallexample-a -ax -d@var{letters} -fpretend-float-fprofile-arcs -ftest-coverage-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2-ggdb -gstabs -gstabs+ -gxcoff -gxcoff+-p -pg -print-file-name=@var{library} -print-libgcc-file-name-print-prog-name=@var{program} -print-search-dirs -save-temps@end smallexample@item Optimization Options@xref{Optimize Options,,Options that Control Optimization}.@smallexample-fbranch-probabilities-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks-fdelayed-branch -fexpensive-optimizations-ffast-math -ffloat-store -fforce-addr -fforce-mem-ffunction-sections -finline-functions-fkeep-inline-functions -fno-default-inline-fno-defer-pop -fno-function-cse-fno-inline -fno-peephole -fomit-frame-pointer-frerun-cse-after-loop -fschedule-insns-fschedule-insns2 -fstrength-reduce -fthread-jumps-funroll-all-loops -funroll-loops-O -O0 -O1 -O2 -O3@end smallexample@item Preprocessor Options@xref{Preprocessor Options,,Options Controlling the Preprocessor}.@smallexample-A@var{question}(@var{answer}) -C -dD -dM -dN-D@var{macro}@r{[}=@var{defn}@r{]} -E -H-idirafter @var{dir}-include @var{file} -imacros @var{file}-iprefix @var{file} -iwithprefix @var{dir}-iwithprefixbefore @var{dir} -isystem @var{dir}-M -MD -MM -MMD -MG -nostdinc -P -trigraphs-undef -U@var{macro} -Wp,@var{option}@end smallexample@item Assembler Option@xref{Assembler Options,,Passing Options to the Assembler}.@smallexample-Wa,@var{option}@end smallexample@item Linker Options@xref{Link Options,,Options for Linking}.@smallexample@var{object-file-name} -l@var{library}-nostartfiles -nodefaultlibs -nostdlib-s -static -shared -symbolic-Wl,@var{option} -Xlinker @var{option}-u @var{symbol}@end smallexample@item Directory Options@xref{Directory Options,,Options for Directory Search}.@smallexample-B@var{prefix} -I@var{dir} -I- -L@var{dir} -specs=@var{file}@end smallexample@item Target Options@c I wrote this xref this way to avoid overfull hbox. -- rms@xref{Target Options}.@smallexample-b @var{machine} -V @var{version}@end smallexample@item Machine Dependent Options@xref{Submodel Options,,Hardware Models and Configurations}.@smallexample@emph{M680x0 Options}-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040-m68060 -m5200 -m68881 -mbitfield -mc68000 -mc68020 -mfpa-mnobitfield -mrtd -mshort -msoft-float -malign-int@emph{VAX Options}-mg -mgnu -munix@emph{SPARC Options}-mcpu=@var{cpu type}-mtune=@var{cpu type}-mcmodel=@var{code model}-malign-jumps=@var{num} -malign-loops=@var{num}-malign-functions=@var{num}-m32 -m64-mapp-regs -mbroken-saverestore -mcypress -mepilogue-mflat -mfpu -mhard-float -mhard-quad-float-mimpure-text -mlive-g0 -mno-app-regs -mno-epilogue-mno-flat -mno-fpu -mno-impure-text-mno-stack-bias -mno-unaligned-doubles-msoft-float -msoft-quad-float -msparclite -mstack-bias-msupersparc -munaligned-doubles -mv8@emph{Convex Options}-mc1 -mc2 -mc32 -mc34 -mc38-margcount -mnoargcount-mlong32 -mlong64-mvolatile-cache -mvolatile-nocache@emph{AMD29K Options}-m29000 -m29050 -mbw -mnbw -mdw -mndw-mlarge -mnormal -msmall-mkernel-registers -mno-reuse-arg-regs-mno-stack-check -mno-storem-bug-mreuse-arg-regs -msoft-float -mstack-check-mstorem-bug -muser-registers@emph{ARM Options}-mapcs-frame -mapcs-26 -mapcs-32-mlittle-endian -mbig-endian -mwords-little-endian-mshort-load-bytes -mno-short-load-bytes-msoft-float -mhard-float-mbsd -mxopen -mno-symrename@emph{MN10300 Options}-mmult-bug-mno-mult-bug@emph{M32R/D Options}-mcode-model=@var{model type} -msdata=@var{sdata type}-G @var{num}@emph{M88K Options}-m88000 -m88100 -m88110 -mbig-pic-mcheck-zero-division -mhandle-large-shift-midentify-revision -mno-check-zero-division-mno-ocs-debug-info -mno-ocs-frame-position-mno-optimize-arg-area -mno-serialize-volatile-mno-underscores -mocs-debug-info-mocs-frame-position -moptimize-arg-area-mserialize-volatile -mshort-data-@var{num} -msvr3-msvr4 -mtrap-large-shift -muse-div-instruction-mversion-03.00 -mwarn-passed-structs@emph{RS/6000 and PowerPC Options}-mcpu=@var{cpu type}-mtune=@var{cpu type}-mpower -mno-power -mpower2 -mno-power2-mpowerpc -mno-powerpc-mpowerpc-gpopt -mno-powerpc-gpopt-mpowerpc-gfxopt -mno-powerpc-gfxopt-mnew-mnemonics -mno-new-mnemonics-mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc-mxl-call -mno-xl-call -mthreads -mpe-msoft-float -mhard-float -mmultiple -mno-multiple-mstring -mno-string -mupdate -mno-update-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align-mstrict-align -mno-strict-align -mrelocatable-mno-relocatable -mrelocatable-lib -mno-relocatable-lib-mtoc -mno-toc -mtraceback -mno-traceback-mlittle -mlittle-endian -mbig -mbig-endian-mcall-aix -mcall-sysv -mprototype -mno-prototype-msim -mmvme -mads -myellowknife -memb-msdata -msdata=@var{opt} -G @var{num}@emph{RT Options}-mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs-mfull-fp-blocks -mhc-struct-return -min-line-mul-mminimum-fp-blocks -mnohc-struct-return@emph{MIPS Options}-mabicalls -mcpu=@var{cpu type} -membedded-data-membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64-mgpopt -mhalf-pic -mhard-float -mint64 -mips1-mips2 -mips3 -mlong64 -mlong-calls -mmemcpy-mmips-as -mmips-tfile -mno-abicalls-mno-embedded-data -mno-embedded-pic-mno-gpopt -mno-long-calls-mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats-mrnames -msoft-float-m4650 -msingle-float -mmad-mstats -EL -EB -G @var{num} -nocpp@emph{i386 Options}-mcpu=@var{cpu type}-march=@var{cpu type}-mieee-fp -mno-fancy-math-387-mno-fp-ret-in-387 -msoft-float -msvr3-shlib-mno-wide-multiply -mrtd -malign-double-mreg-alloc=@var{list} -mregparm=@var{num}-malign-jumps=@var{num} -malign-loops=@var{num}-malign-functions=@var{num}@emph{HPPA Options}-mbig-switch -mdisable-fpregs -mdisable-indexing -mfast-indirect-calls-mgas -mjump-in-delay -mlong-load-store -mno-big-switch -mno-disable-fpregs-mno-disable-indexing -mno-fast-indirect-calls -mno-gas-mno-jump-in-delay-mno-long-load-store-mno-portable-runtime -mno-soft-float -mno-space -mno-space-regs-msoft-float-mpa-risc-1-0 -mpa-risc-1-1 -mportable-runtime-mschedule=@var{list} -mspace -mspace-regs@emph{Intel 960 Options}-m@var{cpu type} -masm-compat -mclean-linkage-mcode-align -mcomplex-addr -mleaf-procedures-mic-compat -mic2.0-compat -mic3.0-compat-mintel-asm -mno-clean-linkage -mno-code-align-mno-complex-addr -mno-leaf-procedures-mno-old-align -mno-strict-align -mno-tail-call-mnumerics -mold-align -msoft-float -mstrict-align-mtail-call@emph{DEC Alpha Options}-mfp-regs -mno-fp-regs -mno-soft-float -msoft-float-malpha-as -mgas-mieee -mieee-with-inexact -mieee-conformant-mfp-trap-mode=@var{mode} -mfp-rounding-mode=@var{mode}-mtrap-precision=@var{mode} -mbuild-constants
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -