Excerpt from http://blog.9cbs.net/casularm/archive/2005/03/09/316143.aspx
Use syntax: GCC [option | filename] ... G [option | filename] ... where option is the option when using GCC (will be detailed later), and FileName is a file description to the GCC: this C Compiler with C has been integrated with related programs that produce new programs. Generating a new procedure requires four phases: pretreatment, compile, assembly, link, and these two compilers can process the input files different stages. Although the extension of the original program can be used to distinguish the language used by the original program code, the different compiler, its preset handler is different: the GCC presets via the pre-processed (extended names .i) The C language is handled in C's linking. G defaults to the C language via the pre-processed (extension .i) and processes the program linkage to C connection mode. The extension of the original program code indicates the language used by the written program used, and the corresponding processing method: .c C original program; pretreatment, compile, assembly .C C original program; pre-processing, compilation, assembly .cc C original program ; Pretreatment, compilation, assembly .cxx C original program; pretreatment, compile, compilation .m Objective-C original program; pre-processing, compilation, assembly .I has passed the pre-processed C original program; compilation, assembly .ii already C original program for pre-processing; compile, assembly. S-combined language original program; assembly. S-combined language original program; pre-processing, assembly .h pre-processing file (header file); (not often in the instruction line) The extension file is processed by the link, usually: .o Object File .a Archive File unless the compilation process has an error, "link" must be the final stage of generating a new program. However, you can also stop one of the four phases in four phases of options such as -c, -s or -e. In the coupling phase, all the .o files, libraries, and other files that cannot be identified from the original code (including the Object File that are not extended, as well as the extension .a), including .a .a archive file) Both will be handed over (in the instruction line as the parameter passing to the connection program). Options: Different options must be separated:, for example, `-dr 'This option is not the same as` -d -r'. Most of the larger `-f 'and` -w' options have two forms: -fname and -fno-name (or -wname and -wno-name). The following is only listed in the non-preset form. The following is a summary of all options. Classified in the form. The meaning of the option will also make another section.
General (rough, commonly used) option -c -s -e -o file -pipe -v -x language programming language options -ansi -fall-virtual -fcond-mismatch -fdollars-in-IdentifierS -fenum-int-equiviV -fexternal-templates -fno-asm -fno-builtin -fno-strict-prototype -fsigned-bitfields -fsigned-char -fthis-is-variable -funsigned-bitfields -funsigned-char -fwritable-strings -traditional -traditional-cpp -trigraphs compile time warning option -FSYNTAX-Only -pedantic -pedantic-errotes -w -w -wall -waggregate-return -wcast-align -wcast-qual -wchar-subscript -wcomment -wconversion -wenum-clamp -wconversion -wenum-clamp -werror- wformat -Wid-clash-len -Wimplicit -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-import -Wparentheses -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch - Wtemplate-debugging -wuninitial -wtrigraphs -wuninitialized -wunused -wwrite-strings debug option -a -dletters -fpretenD- FLOAT -G -GLEVEL -GCOFF -GXCOFF -GXCOFF -GDWARF -GDWARF -GSTABS -GSTABS -GGDB -P -PG -SAVE-TEMPS -PRINT-file-name = library -print-libgcc-file-name -Print-PROG- Name =
program optimization options -fcaller-saves -fcse-follow-jumps -fcse-skip-blocks -fdelayed-branch -felide-constructors -fexpensive-optimizations -ffast-math -ffloat-store -fforce-addr -fforce-mem - FINLINE-FUNCTIONS -FKEEP-INLINE-FUNCTIONS -FMEMOIZE-LOOKUPS -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-reduuce -ft-jumps -funroll-all-loops -funroll-loops -o-ods pre-processing option -aAsSERTION -C -DD -DM -DN-DMACRO [= DEFN] -E -H -IDIRAFTER DIR -IPREFIX FILE-IWITHPREFIX DIR -M -MD -MM -MMD -NOSTDINC -P -UMACRO -UNDEF assembler option -wa, Option link program - LLIBRARY - Nostartfiles -nostdlib -static -shared -symbolic -xlinker option -wl, option -u symbol
Directory Options - BPREFIX -IDIR -I- -LDIR TARGET OPTIONS -B MACHINE -V Version and Machine (Platform) Related options M680x0 options -m68000 -m68020 -m68020-40 -M68030 -M68040 -M68881 -Mbitfield -MC68000 -MC68020 mfpa -mnobitfield -mrtd -mshort -msoft-float VAX Options -mg -mgnu -munix SPARC Options -mepilogue -mfpu -mhard-float -mno-fpu -mno-epilogue -msoft-float -msparclite -mv8 -msupersparc -mcypress Convex Options -margcount -mc1 -mc2 -mnoargcount AMD29K Options -m29000 -m29050 -mbw -mdw -mkernel-registers -mlarge -mnbw -mnodw -msmall -mstack-check -muser-registers M88K Options -m88000 -m88100 -m88110 -mbig- PIC-MCHECK-ZERO-DIVISION -MHANDLE-LARGE-SHIFT -MIDENTIFY-REVISION-MNO-CHECK-ZERO-DIVISITION -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 -m SERIALIZE-VOLATILE -MSHORT-DATA-NUM -MSVR3 -MSVR4 -MTRAP-LARGE-SHIFT -MUSE-DIV-INSTRUCTION -MVERSION-03.00 -MWARN-PASSED-STRUCTS RS6000 Options -MFP-in-Toc -Mno-FOP-IN- TOC RT OPTIONS -MCALL-LIB-MUL-MFP-Arg-in-fpregs -mfp-arg-in-gregs -mfull-fp-block-MHC-STRUCT-RETURN -MIN-LINE-MUL-MMINIMUM-FP-Blocks - Mnohc-struct-return mips options -mcpu =
CPU TYPE -MIPS2 -MIPS3 -MINT64 -MLONG64-MLONGLONG128-MMIPS-AS -MGAS -MRNAMES-MNO-RNAMES -MGPOPT -MNO-GPOPT-MNO-MNO-Stats -Mmemcpy-Mno-MNO-Mno-MIPS-TFILE-MMIPS -TFILE-MSOFT-FLOAT-MNO-FLOAT-MABICALLS -MNO-ABICALLS-MNO-HALF-PIC -G NUM-NOCPP I386 OPTIONS -M486 -MNO-486 -MSOFT-FLOAT -MNO-FP-RET- IN-387 HPPA OPTIONS -MPA-RISC-1-0 -MPA-RISC-1-1 -Mkernel-MShared-Libs-Mno-Shared-Libs -mlong-Calls-Mdisable-fpregs-Mdisable-Indexing -Mtrailing-Colon I960 OPTIONS-MCPU-TYPE-MNUMERICS-MSOFT-FLOAT-MLEAF-PROCEDURES-MNO-LEAF-PROCEDURES -MTAIL-CALL -MNO-TAIL-CALL-MNODED - MNO-COMPLEX-ADDR-MCODE-Align-Mno-code- Align -Mic-Compat -Mic 2.0-Compat -Mic3.0-Compat -Masm-Compat -mintel-Asm-MStrict-align-mno-strict-align-mold-align-mald-align Dec alpha Options -mfp -regs-malo-fp-regs-malo-soft-float-msoft-float system v options -g -Qy-qn -yp, paths -ym, dir code generation option option Options -fcall-saved-reg-finhibit-size-directive -fnonnull-ibjects -fno-common -fno-identification fno-gnu-linker -fpcc-struct-return -fpic -fPIC -freg-struct-returno -fshared-data -fshort-enums -fshort-double -fvolatile -fvolatile-global -fverbose-asm pRAGMAS Two `#pragma 'directives are supported for GNU C , to permit using the same header file for two purposes: as a definition of interfaces to a given object class, and as the full definition of the contents of that object class #pragma interface (C .
only.) Use this directive in header files that define object classes, to save space in most of the object files that use those classes. Nor- mally, local copies of (backup copies certain information of inline member functions, debugging information, and the internal tables that implement vir- tual functions) must be kept in each object file that includes class definitions. You can use this pragma to avoid such duplication. When a header file containing `#pragma interface 'is included in a compilation, this auxiliary information will not be generated (unless the main input source file it- self uses `#pragma implementation '). Instead, the object files will contain references to be resolved at link time. #pragma implementation #pragma implementation" objects.h " (C only.) Use this pragma in a main input file, when you want! Output from include Header Files T o be generated (and made globally visible). The included header file, in turn, should use `#pragma interface '. Backup copies of inline mem- ber functions, debugging information, and the in- ternal tables used to implement virtual functions are all generated in implementation files If you use `#pragma implementation 'with no argu- ment, it applies to an include file with the same basename as your source file; for example, in` allclass.cc'., `#pragma implementation ' ITself Is Equivalent to `#pragma importation" allclass.h "'