GNU Compiler family GCC internal password probing

Source: Internet
Author: User
The GNU Compiler family's GCC internal password-Linux general technology-Linux programming and kernel information. The following is a detailed description. GCC User Guide

Syntax:
Gcc [option | 20021312141356.htm]...
G ++ [option | 20034712141356.htm]...

Where option is the option used for gcc (which will be detailed later ),
2001000012141356.htm is the file to be processed with gcc.
Note:
This C and C ++ compiler have integrated the related programs that generate new programs. Production
Creating a new program requires four stages: preprocessing, compilation, assembly, linking,
Both compilers can process input files in different stages. Although the original program
The extension can be used to distinguish the language used to write the original program code, but different compiler
The default handlers are different:

Gcc defaults that files that have been preprocessed (with the extension. I) are in C language, and
The link phase is processed in C connection mode.

G ++ defaults that files that have been preprocessed (with the extension. I) are in the C ++ language.

The sequential connection phase is processed in the C ++ connection mode.


The extension of the original code indicates the language used for programming and the corresponding
Management Method:

Original. c program; preprocessing, compilation, and assembly
Original. C ++ program; preprocessing, compilation, and assembly
. Cc C ++ original program; preprocessing, compilation, and assembly
. Cxx C ++ original program; preprocessing, compilation, and assembly
. M Objective-C original program; preprocessing, compilation, assembly
. I original C program that has been preprocessed; compilation and assembly
. Ii Original C ++ program that has been preprocessed; compilation and assembly
Original program of. s combination language; Assembly
Original program of. S combination language; preprocessing and compilation
. H pre-processing file (header file); (not frequently displayed in the command line)


Files with other extensions are processed by the link program, usually including:

. O Object file
. A Archive file


Unless an error occurs during the compilation process, the "Link" must be the most
Later Stage. However, you can also set the entire process from
Phase. In the connection phase, all
. O files, libraries, and other files that cannot identify attributes from the file name (including files that do not use. o
Object file with the extension and archive file with the extension.)
It is handled by the link program (the files in the command line are passed as parameters of the link Program
Link program ).


Option:
Different options must be separated. For example, the '-write' option is larger than the'-d-R' option.
Different.

Most of the '-F' and'-W' options have two forms:-fname and
-Fno-name (or-Wname and-Wno-name ). Only the non-preset ones are listed below
Format.

The following is a summary of all options. In the form. The meaning of the option will be explained in another section.
Ming.

General (rough, common) Options
-C-S-E-o file-pipe-v-x language

Program language options
-Ansi-fall-virtual-fcond-mismatch
-Fdollars-in-identifiers-fenum-int-equiv
-Fexternal-templates-fno-asm-fno-builtin
-Fno-strict-prototype-fsigned-bitfields
-Fsigned-char-fthis-is-variable
-Funsigned-bitfields-funsigned-char
-Fwritable-strings-traditional-cpp
-Trigraphs

Warning options during compilation
-Fsyntax-only-pedantic-errors-w-W
-Wall-Waggregate-return-Wcast-align-Wcast-qual
-Wchar-subscript-Wcomment-Wconversion
-Wenum-clash-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-Wtraditional-Wtrigraphs
-Wuninitialized-Wunused-Wwrite-strings

Debugging options
-A-dletters-fpretend-float-g-glevel-gcoff
-Gxcoff +-gdwarf +-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-reduce-fthread-jumps-funroll-all-loops
-Funroll-loops-O-O2

Preprocessing options
-Aassertion-C-dD-dM-dN-Dmacro [= defn]-E-H
-Idirafter dir-include file-imacros file-iprefix
File-iwithprefix dir-M-MD-MM-MMD-nostdinc-P
-Umacro-undef

Assembler options
-Wa, option

Link Program Options
-Llibrary-nostartfiles-nostdlib-static-shared
-Symbolic-Xlinker option-Wl, option-u symbol

DIRECTORY Options
-Bprefix-Idir-I-Ldir

Target Options
-B machine-V version

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

Iscsi Options
-Mepilogue-mfpu-mhard-float-mno-fpu
-Mno-epilogue-msoft-float-msparclite-mv8
-Msupernames-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-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-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-blocks-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-mstats-mno-stats-mmemcpy
-Mno-memcpy-mno-mips-tfile-mmips-tfile
-Msoft-float-mhard-float-mabicils-mno-abicils
-Mhalf-pic-mno-half-pic-G num-nocpp

I386 Options
-Mbench-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-CILS-mdisable-fpregs
-Mdisable-indexing-mtrailing-colon

I960 Options
-Mcpu-type-mnumerics-msoft-float
-Mleaf-procedures-mno-leaf-procedures-mtail-call
-Mno-tail-call-mcomplex-addr-mno-complex-addr
-Mcode-align-mno-code-align-mic-compat
-Mic2.0-compat-mic3.0-compat-masm-compat
-Mintel-asm-mstrict-align-mno-strict-align
-Mold-align-mno-old-align

DEC Alpha Options
-Mfp-regs-mno-fp-regs-mno-soft-float-msoft-float

System V Options
-G-Qy-Qn-YP, paths-Ym, dir

Code Generation Options
-Fcall-saved-reg-fcall-used-reg-ffixed-reg
-Finhibit-size-directive-fnonnull-objects
-Fno-common-fno-ident-fno-gnu-linker
-Fpcc-struct-return-fpic-fPIC
-Freg-struct-returno-fshared-data-fshort-enums
-Fshort-double-fvolatile-global
-Fverbose-asm

PRAGMAS
Two '# pragma' ctictives are supported for gnu c ++,
Permit using the same header file for two purposes: as
Definition of interfaces to a given object class, and
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 certain information (backup
Copies of inline member functions, debugging infor-
Mation, and the internal tables that implement vir-
Tual functions) must be kept in each object file
That includes des class definitions. You can use this
Pragma to avoid such duplication. When a header
File ining '# pragma interface' is supported in
A compilation, this auxiliary information will not
Be generated (unless the main input source file it-
Self uses '# pragma implementation'). Instead,
Object files will contain in 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 full output from included header
Files to be generated (and made globally visible ).
The encoded header file, in turn, shocould 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' by itself
Is equivalent to '# pragma implementation
"Allclass. h" '. Use the string argument if you want
A single implementation file to include code from
Multiple header files.

There is no way to split up the contents of a sin-
Gle header file into multiple implementation files.

File description
File. c C source file
File. h C header (preprocessor) file
File. I pre-processed C source file
File. C ++ source file
File. cc C ++ source file
File. cxx C ++ source file
File. m Objective-C source file
File. s assembly language file
File. o object file
A. out link edited output
TMPDIR/cc * temporary files
LIBDIR/cpp preprocessor
LIBDIR/PC3 compiler for C
LIBDIR/cc1plus compiler for C ++
LIBDIR/collect linker front end needed on some machines
LIBDIR/libgcc. a GCC subroutine library
/Lib/crt [01n]. o start-up routine
LIBDIR/ccrt0 additional start-up routine for C ++
/Lib/libc. a standard C library, see man page intro (3)
/Usr/include standard directory for # include files
LIBDIR/include standard gcc directory for # include files
LIBDIR/g ++-include additional g ++ directory for # include

LIBDIR is usually/usr/local/lib/machine/version.
TMPDIR comes from the environment variable TMPDIR (default
/Usr/tmp if available, else/tmp ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.