GCC Chinese Manual (below) ZZ

xiaoxiao2021-03-06  15

-msvr4

-msvr3

turn on

(`-msvr4 ')

Or close

(`-msvr3 ')

with

System v

Fourth edition

(SVR4)

Related compiler extensions

.

The effect is as follows

:

*

Which compilation syntax is output?

(

you can use

`-mversion-03.00 '

Options separately

).

*

`-msvr4 '

Make

C

Preparation instrument identification

`#pragma weak '

instruction

*

`-msvr4 '

Make

GCC

Output extra declaration instructions

(Declarative Directive),

Use

SVR4.

In addition to SVR4 configuration, `-msvr3 'is the default option for all M88K configurations.

-mtrap-large-shift

-MHandle-large-shift

Contains some instructions

,

Used to detect greater than

31

Bit shift

Bit-shift;

According to the corresponding option

,

Delicate such a displacement

(Trap)

Or perform proper processing code

.

by default

, GCC

Do not do special treatment for large dishes

.

-Muse-div-instructionion

Very early

88K

Model

(DIV)

Division directive

,

So by default

GCC

Avoid producing this directive

.

And this option tells

GCC

This instruction is safe

.

-MVersion-03.00

in

DG / UX

There are two styles in configuration

SVR4.

This option is modified

-msvr4,

select

Hybrid-coff

or

Real-Elf

style

.

Other configurations ignore this option

.

-Mwarn-Passed-Structs

If a function is used as a parameter or result

, GCC

warning

.

along with

C

Development of language

,

People have changed the convention for the conveying structure

,

It often leads to the problem of transplantation

.

by default

, GCC

Will not warn

.

The following option is used for IBM RS6000:

-MFP-in-TOC

-MNO-FP-IN-TOC

Control whether floating point constant is placed in the content table

(TOC)

in

,

Content table storage all global variables and function addresses

.

by default

, GCC

Put the floating point constant here

;

in case

TOC

overflow

, `-Mno-fp-in-Toc '

Option can reduce

TOC

the size of

,

This will avoid overflow

.

The following `-m 'option is used for IBM RT PC:

-min-line-mul

Embedded code for integer multiplication

.

This is the default option

.

-mcall-lib-mul

For integer multiplication

Lmul $$.

-mfull-fp-blocks

Generate full-size floating point data blocks

,

include

IBM

Suggested minimum number of activity space

Scratch space.

This is the default option

.

-MMINIMUM-FP-Blocks

Do not include additional activity spaces in floating point data blocks

.

This creates a smaller but slightly slow executable program.

,

Because the activity space must be dynamically allocated

.

-MFP-Arg-in-fpregs

Incompatible

IBM

Call the agreed call sequence

,

Transfer floating point parameters through floating point registers

.

note

,

If this option is specified

, Varargs.h

with

stdargs.h

Floating point unit will not be supported

.

-MFP-Arg-in-GREGS

Process floating point parameters using normal call

.

This is the default option

.

-MHC-STRUCT-RETURN

Return the structure greater than one word via memory

,

Not through the register

.

Compatibility

MetaWare Highc (HC)

translater

.

use

`-fpcc-struct-return '

Options can be compatible

Portable C

translater

(PCC).

-Mnohc-struct-return

if it is possible

,

Returns some of the structures greater than one word through the register

.

This is the default option.

If intended

IBM

Provided compiler

,

please use

`-fpcc-struct-return '

or

`-mhc-struct-return '

Option

.

The following `-m 'option is used for the MIPS family:

-mcpu = CPU-TYPE

When the command is generated

,

Suppose the default machine type is

CPU-TYPE.

By default

CPU-Type

Yes

DEFAULT, GCC

The command will be selected for the longest cycle time

,

This will make the code in all

MIPS

Processor runs with reasonable speed

CPU-Type

Other options are

R2000, R3000, R4000,

with

R6000.

Although a certain one

CPU-Type

Rear

, GCC

Arrange the selected chip to arrange the corresponding work

,

But if not specified

?? -Mips2

or

-MIPS3

Option

,

The compiler does not output any inconsistent

MIPS ISA (Instruction Set Architecture)

First class code

.

-MIPS2

Output

MIPS ISA

Secondary command

(

Possible extension

,

Square root instruction

). -mcpu = r4000

or

-mcpu = r6000

Option must be

-MIPS2

Join

.

-MIPS3

Output

MIPS ISA

Three-level directive

(64

Bit command

). -mcpu = r4000

Option must be

-MIPS2

Join

(

Translation

:

Suspected

-MIPS3)

-mint64

-mlong64

-mlonglong128

These options are currently inadvertent

.

-MMIPS-AS

Generate

MIPS

Compiler code

,

use simultaneously

MIPS-TFILE

Add ordinary debugging information

.

For most platforms, this is the default option

,

apart from

OSF / 1

Reference platform

,

It uses

OSF / ROSE

Target format

.

If you open any one

-ggdb, -gstabs,

or

-gstabs

Option switch

MIPS-TFILE

Proceed

Stab

Encapsulate

MIPS ECOFF

inside

.

-mgas

Generate

Gnu

Compiler code

.

in

OSF / 1

This is the default option on the reference platform

,

It uses

OSF / ROSE

Target format

.

-mrnames

-Mno-RNames

-mrnames

Switch option tells the output code to use

MIPS

Software Name Description Register

,

Instead of hardware name

(

that is

,

use

A0

instead

$ 4). GNU

Assembler does not support

-mrnames

Option

,

and

MIPS

Assembler runs

MIPS C

Preprocessor processing source file

. -MNO-RNAMES

Is the default option

.

-MgPopt

-Mno-gpopt

-MgPopt

The switch option requires writing all the data declarations in front of the text section.

,

Make various

MIPS

Compilers for short types or static data items

SHORT GLOBAL or Static Data Items

Output single-word memory access rather than double word memory access

.

When the compilation optimization is opened

,

This is the default function

.

-mstats

-Mno-Stats

Dedicated to the embedded function each time

(non-inline function)

Rear

, -mstats

Switch options make the compiler to the standard error file to output a line about the statistics about the program

(

Save the number of registers

,

Stack size

,

and many more

).

-mmemcpy

-Mno-memcpy

-mmemcpy

Switch options make all block mobile operations call appropriate

String

function

(Memcpy)

or

bcopy,

Instead of generating embedded code

.

-MMIPS-TFILE

-Mno-MIPS-TFILE

when

MIPS

Assembler generation

MIPS-TFILE

file

(

Used to help debug

)

Rear

, -Mno-MIPS-TFile Switch Option Block Compiler

MIPS-TFILE

Later processing

(PostProcess)

Target file

.

Do not run

MIPS-TFILE

There is no local variable for the debugger

.

In addition

STAGE2

with

STAGE3

The target file will pass the temporary file name to the assembler

,

Embed in the target file

,

This means that the target file is not compared

.

-MSoft-float

Output contains floating point library calls

.

caveat:

Required library is not

GNU CC

a part of

.

Generally speaking, using this model

C

Compiler

,

But you can't use it directly for cross-compilation

,

You must arrange yourself

,

Provide cross-compilation applicable library functions

.

-mhard-float

Output contains floating point instructions

.

If the compiler is not changed

,

This is the default option

.

-mfp64

The compiler considers the status word

FR

Position

(ON),

That is to say

32 64-bit

Floating point register

,

Instead of

32 32-bit

Floating point register

.

At the same time, you must open

-mcpu = r4000

with

-MIPS3

switch

.

-mfp32

Be considered

32 32-bit

Floating point register

.

This is the default option

.

-mabicalls

-Mno-Abicalls

Output

(

No output

) .abicalls, .cpload,

with

.cprestore

Pseudo-instruction

,

some

System v.4

Version for location-independent code

.

-mhalf-pic

-Mno-Half-Pic

-mhalf-pic

Switch options require the external reference pointer to the data segment

,

And load memory

,

Do not put it in a text section

.

This option does not work

.

-G Num

Put less than or equal

Num

The global or static data of bytes is placed in a small data segment or

BSS

segment

,

Not ordinary data segments or

BSS

segment

.

Such a assembler can output a global pointer

(GP

or

$ 28),

Single word memory access instruction instead of document double word instruction

.

by default

,

use

MIPS

Assembler

Num

Yes

8,

and

Gnu

Assembler is

0.

In addition

-Gnum

Options are also passed to the assembler and connector

.

All modules must be the same

-Gnum

Character compilation

.

-NOCPP

Compilation user assembly file

(

Have

`.s'

suffix

)

Time

,

tell

MIPS

Assembler does not run a pre-processor

.

The following `-m 'option is used for Intel 80386 computers: -m486

-MNO-486

Controls whether to generate

486

Optimized code

.

-MSoft-float

Output contains floating point library calls

.

caveat:

Required library is not

GNU CC

a part of

.

Generally speaking, using this model

C

Compiler

,

But you can't use it directly for cross-compilation

,

You must arrange yourself

,

Provide cross-compilation applicable library functions

.

Place the floating point return value on the 80387 register stack machine, even if the `-msoft-float 'option is set, some floating point opcode may be issued.

-MNO-FP-RET-IN-387

No need to

FPU

Register returns a function value

.

Usually the function call agreement places the return value of Float and Double in the FPU register, even if there is no FPU. This kind of practice is that the operating system should simulate the FPU.

The `-Mno-fp-Ret-IN-387 'option returns the floating point value through a normal CPU register.

The following `-m 'option is used for HPPA computers:

-MPA-RISC-1-0

generate

PA 1.0

Processor's Target Code

.

-MPA-RISC-1-1

generate

PA 1.1

Processor's Target Code

.

-Mkernel

Generate a target code suitable for kernel

.

Special avoidance

Add

instruction

,

It has a parameter is

DP

register

;

use

Addil

instead

Add

instruction

.

This can be avoided

HP-UX

A seriousness of the connector

Bug.

-MShared-Libs

Generate

HP-UX

Shared library target code

.

This option has not implemented all functions

,

Correct

PA

Target default is closed

.

Using this option can cause the compiler to generate an error target code

.

-Mno-shared-libs

Do not generate connections

HP-UX

Shared library target code

.

this is

PA

Default option for the target

.

-mlong-calls

The resulting target code allows the function call in the same source file

,

The distance between the calling point and the modulated function can exceed

256K

Far away

.

No need to open this switch option

,

Unless the connector gives out

`` Branch out of range errors``

Such error

.

-mdisable-fpregs

Prevent any case use floating point register

.

Compiled kernel requires this option

,

The execution environment of the kernel switch floating point register is very slow

.

If this switch option is opened, it tries to float operation.

,

Compiling will fail

.

-mdisable-indexing

Prevent compiler from using index address mode

Indexing Address Mode.

In this way

Mach

Compile

MIG

Generated code

,

Can avoid some very embarrassed issues

.

-mtrailing-color

Definition in tag

(label definition)

Add a colon at the end

(

Use

ELF

Assembler

).

The following `-m 'option is used for Intel 80960 computers:

-MCPU-TYPE

The default machine type is

CPU-Type,

Enable the compiler to generate the corresponding instruction

,

Address mode and memory

.

default

CPU-Type

Yes

KB;

Other options

KA, MC, CA, CF, SA,

with

SB.

-MNUMERICS

-MSoft-float

-MNUMERICS

The switch option indicates that the processor does not support floating point instructions.

. -MSoft-float

Switch options point out that it should not be considered to support floating point operations

.

-mleaf-procedures

-Mno-Leaf-Procedures

attempt

(

Or prevent

)

Change the leaf process

(Leaf Procedure),

Make it

BAL

Instructions and

Call

Instruction call

.

For direct function calls

,

in case

BAL

The instruction can be replaced by the assembler or connector

,

This can produce more effective code

,

But in other cases produce less low-efficiency code

,

For example, by function pointer call function

,

Or use connector that does not support this optimization

.

-mtail-call

-Mno-Tail-Call

carried out

(

Do not execute

)

More attempts

(

In addition to compilers

),

Optimize the end of the branch

(Tail-Recursive)

transfer

.

You may not need this

,

Because the detection is invalid, there is no completion

.

The default switch is

-MNO-Tail-Call.

-MCOMPLEX-ADDR

-MNO-Complex-Addr

think

(

Or not

)

In the current

I960

Device

,

It is worth using the composite address mode

Complex Addressing Mode.

Composite address mode may not be worth it

K

series

,

But must be used in

C

series

.

Except

CB

with

CC

processor

,

Other processors

-MCOMPLEX-ADDR

Is the default option

.

-mcode-align

-Mno-code-align

Align the target code

8

Byte boundary

(

Or not

),

This will be read like this.

.

Currently only

C

Series Open by default

.

-Mic-compat

-Mic2.0-compat

-Mic3.0-Compat

compatible

IC960 V2.0

or

V3.0.

-Masm-compat

-Mintel-ASM

compatible

IC960

Assembler

.

-mstrict-align

-Mno-strict-align is not allowed

(

Or permission

)

Boundary is not aligned

.

-mold-align

Structure alignment

Structure-alignment)

compatible

Intel

of

GCC

Release

1.3 (

based on

GCC 1.37).

This option is a bit problem

,

because

#pragma align 1

Always do the same setting

,

And can't turn off

.

The following `-m 'option is used for Dec Alpha devices:

-MNO-Soft-Float

-MSoft-float

use

(

Not use

)

Hardware floating point instructions for floating point operations

.

turn on

-MSoft-float

Time

,

Use

`libgcc1.c '

The function of the function performs floating point operations

.

Unless they are replaced by routines they are simulated floating point operations

,

Or similar

,

They are compiled into call simulation routines

,

These routines will issue floating point operations

.

If you don't have floating point

Alpha

Compiler

,

You must ensure that this library is established

,

In order to not adjust the simulation routine

.

Note that Alpha without floating point operation also requires a floating point register.

-mfp-reg

-Mno-fp-regs

Generate

(

Not use

)

Target code for floating point register group

. -MNO-fp-regs

Contain

-MSoft-float

Switch option

.

If you do not use floating point registers

,

Floating point operands are transmitted through integer register like integers

,

Putting the floating point operation

$ 0

Instead of

$ F0.

This is a non-standard call

,

So any function with floating point parameters or return values

,

If

-Mno-fp-regs

Switch compiled target code call

,

It must also compile this option

.

Typical usage of this option is to create kernels, the kernel does not use any floating point registers, so there is no need to save and restore these registers.

The following additional options appear in the SYSTEM V fourth edition, used to compatible with other compilers in these systems:

-G

In the SVR4 system, GCC is compatible with the `-g 'option (and then passed to the connector). But we recommend using the` -symbolic' or `-shared 'option, not the connection option on the GCC command line.

-Qy

Verify the version of the tool for the compiler, output to .IDENT assembly instruction.

-QN

Stop the .IDENT command (default option).

-Yp, DIRS

For `-l 'specified library files, you only search DIRS. You can use the colon from DIRS to separate all directory items.

-YM, DIR

Look for M4 preprocessors in the DIR directory. The assembler uses this option.

Code Generation Option (Code Generation Option)

The following options and platforms are independent of controlling the interface convention generated by the target code.

Most options begin with `-f '. These options have two formats that determine and negate;` -ffoo''s negative format is `-fno-foo '. The following description will only list one of these formats --- Non-default Format. You can speculate another format by adding or removing `NO- '.

-fnonnull-objects

Assume that the object obtained by reference (Reference) is not NULL (C ).

In general, GNU C is conservatively assumed by reference to the object obtained by reference. For example, the compiler will check A of the following code is not NULL:

Obj & a = g (); A.F (2);

Check that similar references require additional code, but for many programs are unnecessary. If your program does not require this check, you can ignore it with the `-fnonnull-objects' option.

-FPCC-STRUCT-RETURN

When the function returns the Struct and UNION values, the same parameters as the local compiler are adopted. For smaller structures, this agreed efficiency is low, and many machines cannot be reached; its advantage is to allow GCC to compile target code The target code compiled with the PCC is called each other.

-freg-struct-return

It is possible to return Struct and UNION function values ​​through registers. For smaller structures, it is more efficient than -fpcc-struct-return. If neither -fpcc-struct-return, no -freg-struct- Return, GNU CC defaults to use the target convention for the target. If there is no standard convention, the GNU CC uses -fpcc-struct-return by default.

-fshort-enums

Give the enum type only the number of bytes of the value domain range it declared. That is to say, the ENUM type is equal to the minimum integer type of size.

-fshort-double

The size of the Double type and float.

-fshared-data

Data and non-const variables that require compilation results are shared data, not private data. This difference is only meaningful above some operating systems, where shared data is shared between several processes of the same program, while private data is in each There is a one in the process.

-fno-common

Even if the global variables that are not initialized are also assigned to the target file BSS segment, instead of setting them as a common block (COMMON block). Such results are, if the same variable is declared in two different compilation results (no use EXTERN), incorrectly generated when connecting them. The only case where this option is useful is that you want to confirm that the program can run on other systems, while other systems always do.

-fno-ident

Ignore the `#ident 'instruction.

-fno-gnu-linker

Do not output global initialization components (such as C constructs sub-recipes) to output the format used for GNU connector (on the GNU connector is a standard method). When you plan to use non-GNU connector, you can use this option Non-GNU connector also requires a Collect2 program to ensure that the system connector is placed in a constructor and a CONSTRUctor. (The Collect2 program is included in the GNU CC.) For systems that must be used, compiler drivers The program GCC is automatically configured to do this.

-finhibit-size-directive

Do not output .Size assembly instructions, or other similar instructions, when a function is divided into two, two parts can cause problems in the middle distance. When compiling `crtstuff.c ', this option is required; Should not be used.

-FVERBOSE-ASM

Place additional annotation information when you output assembly code. This option is only used to read the assembly output (it may debug the compiler yourself).

-fvolatile

Make the compiler that all memory accessible by the pointer is viable memory.

-fvolatile-global

Make the compiler that all external and global variables are variable memory.

-fpic

If this target machine is supported, the compiler generates a location-independent target code. Suitable for shared library.

-fpic

If this target machine is supported, the compiler is independent of the output location. Suitable for dynamic linking, even if the branch requires a wide range of shifts.

-FFIXED-REG

Take a register named register to see the fixed register; the generated target code should not reference it (except as a stack pointer, frame pointer, or other fixed role).

The REG must be the name of the register. The register name depends on the machine and describes the register_names macro definition of the macro file with the machine.

This option has no negation format because it lists the three selection.

-fcall-useed-reg

Treat the registers named REG as you can use, you cannot use the function call between function calls. You can use or use it as a variable, the survival period does not exceed a function. This compiled function does not need to save and restore the REG register.

If in the executable module, the register described in this option is used as a fixed role will produce catastrophic results, such as stack pointers or frame pointers.

This option has no negation format because it lists the three selection.

-fcall-saved-reg

Treat the register named REG by function. You can use or use or be used as a variable, which can even survive between functions. This compiled function saves and resumes the REG register in use.

If in the executable module, the register described in this option is used as a fixed role will produce catastrophic results, such as stack pointers or frame pointers.

Another disaster is used to return a function value with the register description of this option.

This option has no negation format because it lists the three-way selection .pragmas

GNU C supports two `#pragma 'instructions to make the same header files two uses: Object class interface definition, object class complete content definition.

#pragma interface

(C only) In the header file of the target class, use this instruction to save most of the size of the target file that adopts the class. Generally, some information (backup of the embedded member function, debug information, " Realizing the internal table of virtual functions, etc.) The local subscribers must be saved in each target file that contains class definitions. Use this PRAGMA instruction to avoid such replication. These auxiliary information will not be generated (unless the entered primary file uses the `#pragma impLementation 'instruction). Instead, the target file will contain references that can be parsed when connected.

#pragma importation

#pragma importation "Objects.h"

(Only C ) If a complete output is required from the header file (and globally visible), you should use this pragma in the primary input file. The `#pragma interface 'instruction should be used in turn. In the Implementation file, it will be generated The backup, debugging information of all embedded member functions, the internal table of virtual functions, and the like.

If `#pragma importation 'does not with parameters, it refers to containing files with the same basic name as the source file; for example,` #pragma importation' is equal to `#pragma importation allClass.h '. If This string parameter should be used by an Implementation file to introduce code from multiple header files.

It is impossible to divide the contents of a header file to multiple implementation files.

File (file)

File.c C Source File

File.h C header file (preprocessing)

File.i C source file after pre-dealing

FILE.C 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 target file

A.out connection output file

TMPDIR / CC * Temporary file

LIBDIR / CPP Preprocessor

LibDIR / CC1 C compiler

LibDIR / CC1PLUS C compiler

LibDIR / Collect Some Connector Front End (Front End) Programs

Libdir / libgcc.a gcc subroutine library

/LIB/CRT [01N].O startup routine (START-UP)

Additional startup routines for libDir / ccRT0 C

/LIB/LIBC.A standard C library, see other Intro (3)

/ usr / include #include file standard directory

Standard GCC directory for libdir / include #include file

LibDIR / G - Additional g directory for the include #include file

Libdir

Usually / usr / local / lib / machine / version. Tmpdir comes from environment variables Tmpdir (if present, default is / usr / TMP, otherwise / tmp).

See also (See Also)

CPP (1), AS (1), LD (1), GDB (1), ADB (1), DBX (1), SDB (1). Info `GCC ',` CPP', `as',` LD ', and `GDB' entry. Using and porting gnu cc (for version 2.0), Richard M. Stallman; The C Preprocessor, Richard M. Stallman; Debugging with GDB: The GNU Source-Level Debugger, Richard M. Stallman And Roland H. Pesch; Using As: The GNU Assembler, Dean Elsner, Jay Fenlason & Friends; Ld: The GNU Linker, Steve Chamberlain and Roland Pesch.bugs

Check out the GCC manual for the guidance of reporting error.

Copying

Copyright 1991, 1992, 1993 Free Software Foundation, Inc.

Permission is granted to make and distribute Verbatim Copies of this Manual Province 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 that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English.

转载请注明原文地址:https://www.9cbs.com/read-45569.html

New Post(0)